Bring a large pot of salted water to a boil and cook the spaghetti until al dente according to the package instructions. Reserve ½ cup of the pasta water, then drain.
Heat the olive oil in a large skillet over low heat and lightly sauté the minced garlic for about 30 seconds until fragrant.
Add the basil pesto to the skillet and stir gently. Do not overcook, as it may lose its fresh flavor.
Add the cooked spaghetti and toss until evenly coated with the pesto sauce.
Stir in the grated Parmesan cheese, adding a splash of reserved pasta water if needed to create a silky sauce.
Sprinkle with toasted pine nuts and season with salt and black pepper to taste.
Serve immediately, garnished with extra Parmesan cheese, fresh basil leaves, or halved cherry tomatoes if desired.