Bring a large pot of salted water to a boil.
Cook the pasta according to the package directions until al dente.
Reserve ¼ cup of the pasta water, then drain the pasta.
Heat the olive oil in a large skillet over medium heat.
Add the sliced garlic and cook for 30–60 seconds until fragrant.
Add the cherry tomatoes, salt, black pepper, and red pepper flakes. Cook for 8–10 minutes, stirring occasionally, until the tomatoes soften and release their juices.
Stir in the butter, if using, and add the reserved pasta water.
Add the cooked pasta and toss until evenly coated with the sauce.
Stir in the Parmesan cheese and fresh basil until well combined.
Remove from the heat and let the pasta rest for 5 minutes so the sauce coats the pasta evenly.
Garnish with extra Parmesan cheese and basil before serving.