In a large pot, bring salted water to a rolling boil. Add linguine or spaghetti and cook according to the package directions until al dente. Once cooked, drain the pasta, reserving about ½ cup of the starchy pasta water, and set aside.
Heat a large skillet over medium heat. Add 2 tablespoons of butter to the skillet, allowing it to melt and foam slightly. While the butter is melting, pat the shrimp dry with paper towels. Season them generously with salt and freshly cracked black pepper.
Once the butter is melted, stir in the minced garlic and red pepper flakes. Sauté the mixture for about 1 minute, or until the garlic becomes fragrant. Take care to avoid burning the garlic, as it can turn bitter.
Add the seasoned shrimp to the skillet in a single layer. Cook for approximately 2-3 minutes per side, until they are vibrant pink and opaque. Once cooked, remove the shrimp from the skillet and set them aside on a plate.
In the same skillet, add the remaining 2 tablespoons of butter. Once melted, toss in the halved cherry tomatoes and cook for about 3 minutes, allowing them to soften and release some juices. If using spinach, add it at this stage and cook until just wilted.
Return the cooked shrimp to the skillet. Squeeze fresh lemon juice over the shrimp and sprinkle in the lemon zest. Gently toss all ingredients together until well combined. If the mixture appears dry, incorporate a splash of the reserved pasta water or an additional pat of butter until you reach your desired consistency.
Give the dish a taste and adjust the seasoning, adding more salt, pepper, or lemon juice as needed to elevate the flavors.
If you opted for pasta, carefully toss the shrimp mixture with the cooked linguine or spaghetti until thoroughly coated.