Make the pistachio pesto: in a food processor or blender combine the pistachios, sun-dried tomatoes, garlic, basil, crushed red pepper flakes (if using), and a pinch of black pepper; pulse until coarsely chopped.
With the machine running, drizzle in 2 tablespoons olive oil until the mixture becomes smooth, then add 1/2 cup grated Parmesan and pulse just until combined; taste and adjust salt and pepper as needed. Set aside.
Cook the gnocchi: bring a large pot of salted water to a boil and cook the gnocchi according to package instructions. Before draining, reserve 1 cup of the cooking water, then drain the gnocchi completely.
Heat 2 tablespoons olive oil in a large skillet over medium-high heat. Add the drained gnocchi in a single layer (work in batches if needed) and cook undisturbed until the bottoms are golden and crisp, about 3–4 minutes.
Turn the gnocchi and continue to cook, turning occasionally, until all sides are golden and crisp, about 3 more minutes. Remove the skillet from the heat.
Toss the crisped gnocchi with the pistachio pesto, adding a few tablespoons of the reserved cooking water as needed to loosen the sauce to your desired consistency. Serve warm and garnish with additional basil and Parmesan if desired.