Preheat the oven: Set to 400°F (200°C). Place a rack in the middle.
Build the roasting pan: Add tomatoes to a baking dish.
Drizzle with 2 tablespoons olive oil, season with salt, pepper, and red pepper flakes. Toss to coat. Nestle the whole block of feta in the center and drizzle with the remaining tablespoon of oil.
Roast: Bake for 30–35 minutes, until tomatoes burst and the feta is golden at the edges and soft in the center.
Cook the pasta: While it roasts, boil the pasta in well-salted water until just al dente. Reserve 1/2 cup pasta water, then drain.
Add garlic and mash: When the dish comes out of the oven, immediately add the garlic.
Use a spoon to mash the feta and tomatoes into a creamy sauce right in the baking dish.
Toss with pasta: Add the hot pasta and most of the basil. If the sauce seems thick, splash in reserved pasta water a little at a time until silky. Taste and season with more salt, pepper, and red pepper flakes.
Finish and serve: Add lemon zest and a squeeze of juice if using, plus a drizzle of olive oil.
Top with remaining basil and serve warm.