Put a pot of salted water on the stove over high heat to boil.
Make the basil pesto using a mortar and pestle, working quickly to prevent oxidisation: add the garlic cloves and salt to the mortar and use the pestle to pound into a pulp; add the pine nuts, continuing to pound to create a coarse grainy paste.
Gradually add the basil leaves to the mortar, crushing the leaves in a circular motion to incorporate into the garlic paste; add the cheeses, using the pestle to stir them into the paste, then slowly pour in the olive oil, simultaneously stirring until you have a creamy vibrant green paste.
Add the potato gnocchi to the pot of salt boiling water, give it a stir to separate, and cook according to the packet instructions until tender and pillowy.
When the gnocchi is ready, spoon the pesto into a large bowl, add a few tablespoons of pasta water to loosen the pesto and create a creamy sauce. Use a slotted spoon to scoop out the gnocchi and transfer it to the pesto, stirring to coat the gnocchi in sauce. Add a little more pasta water if needed, along with a little more grated cheese, and stir so the gnocchi is well coated in the sauce.
If using the cream, skip the step above and instead heat the cream in a large pan over high heat to reduce it then turn the heat to low. When the gnocchi is ready, spoon the pesto into the cream in the pan and stir to combine. Use a slotted spoon to scoop out the gnocchi and transfer it to the pesto sauce, add a little more grated cheese, and stir so the gnocchi is well coated in the sauce.
Divide the pesto gnocchi between plates, drizzle on a little more extra virgin olive oil if needed, garnish with fresh basil leaves and toasted pine nuts, sprinkle on more grated cheese, and serve immediately with cracked black pepper.