Dice the potato fairly small and snap the green beans (if you're using them).
Boil water for the pasta, and add a handful of table salt when it's boiling, then add the pasta. If you're using the beans/potato, add them too. Cook until al dente, reserve a cup of pasta water (as a just in case) then drain the pasta.
While the pasta is cooking, throw the basil, olive oil, garlic, and most of the pine nuts, cheese, and salt into a small food processor. Blend until it's the consistency you want, adding more olive oil if necessary.
In a large bowl, put a tablespoon or two of butter, a little more Parmesan and pine nuts (and maybe a tiny bit more salt) and add the pesto.
Once you drain the pasta, add to the bowl right away and toss immediately, making sure everything gets a good coating of pesto (add a bit of pasta water if you need to help it come together).
Serve hot, and you can store for several days in airtight containers in the fridge.