Place ⅓ cup pine nuts or walnuts in a small frying pan over medium heat. Cook, tossing occasionally, until light golden brown, toasted, and fragrant, 3 to 5 minutes. Transfer to a food processor fitted with the blade attachment and let cool. Meanwhile, prepare the remaining ingredients.
Grate 2 ounces Parmesan cheese on the smallest holes of a box grater (about ¾ cup, or use ⅔ cup store-bought grated). Pick the leaves from 1 large or 2 medium bunches fresh basil until you have 4 loosely packed cups.
Add the cheese and 2 peeled garlic cloves to the food processor and process until finely chopped, 15 to 20 (1-second) pulses. Add the basil leaves and 1 teaspoon kosher salt. With the motor running, slowly pour in ½ cup extra-virgin olive oil and process until a paste forms, about 30 seconds. Stop and scrape down the sides of the bowl with a flexible spatula. With the motor running, slowly pour in ½ cup heavy cream and process until smooth and creamy, about 30 seconds. Taste and season with more kosher salt as needed.
To serve with pasta: Cook 1 pound dried pasta in a large pot of heavily salted water according to package directions until al dente. Reserve ¾ cup of the pasta water. Drain the pasta and return to the pot. Add all of the pesto and ¼ cup of the pasta water. Toss to combine, adding more of the pasta water a little at a time as needed to thin out, until the pasta is well coated with sauce. Taste and season with more kosher salt as needed.
