01 - Set the oven temperature to 400°F.
02 - In a large ovenproof baking dish, combine cherry tomatoes, garlic, and red onion if using. Drizzle with 2 tablespoons of olive oil, season with salt, black pepper, and red pepper flakes, then toss to coat evenly.
03 - Place the block of feta in the center of the tomato mixture and drizzle remaining 1 tablespoon of olive oil over the feta.
04 - Bake in the preheated oven for 30 minutes until tomatoes are blistered and feta is softened and golden.
05 - While roasting, cook pasta according to package directions until al dente. Reserve ½ cup of pasta cooking water, then drain.
06 - Remove baking dish from oven and mash feta and tomatoes together with a fork to create a creamy sauce. Add drained pasta and half the basil leaves, tossing to combine. Add reserved pasta water gradually to achieve desired sauce consistency.
07 - Serve immediately, garnished with remaining basil and additional black pepper as desired.