Bring a large pot of salted water to a boil and cook the spaghetti or linguine according to package directions until al dente.
Before draining the pasta, scoop out about 1/4 cup of the starchy cooking water and set it aside, then drain the pasta well.
While the pasta cooks, add the fresh basil leaves, cilantro leaves, roasted unsalted cashews, red chili, fish sauce, lime juice, extra-virgin olive oil, and grated Parmesan cheese to a food processor.
Pulse the mixture in the food processor until it forms a thick, fairly smooth pesto, scraping down the sides as needed.
Taste the pesto and season with salt and black pepper, blending again briefly to combine, then set the pesto aside.
Pat the peeled and deveined shrimp dry with paper towels, then season them lightly with a pinch of salt and black pepper.
Heat the olive oil and unsalted butter in a large skillet over medium-high heat until the butter is melted and the mixture is hot but not smoking.
Add the minced garlic to the skillet and cook for about 30 seconds, stirring constantly, until fragrant but not browned.
Add the seasoned shrimp to the skillet in a single layer and cook for 2 to 3 minutes per side, until the shrimp are opaque and just cooked through, then remove the skillet from the heat.
Add the drained pasta to the skillet with the cooked shrimp and garlic, tossing gently to combine everything.
Spoon the basil-cilantro pesto over the pasta and shrimp, tossing until the noodles are evenly coated.
Drizzle in a little of the reserved pasta cooking water, a tablespoon at a time, tossing until the sauce loosens slightly and clings to the pasta.
Taste the Thai Shrimp Basil Pesto Pasta and adjust the seasoning with a bit more salt or black pepper if needed.
Serve the pasta hot, topped with the sliced fresh basil for garnish.