Bring a large pot of heavily salted water to a boil and cook the penne until just al dente according to package directions. Reserve 1/2 cup of the pasta cooking water, then drain the pasta, rinse briefly under cool water, and toss with a drizzle of olive oil; set aside.
Meanwhile, heat 1/4 cup olive oil in a large saucepan or Dutch oven over medium-high heat.
Add the diced onion and sauté until softened, about 5–7 minutes.
Add the minced garlic and crushed red pepper flakes (start with the lower amount if you prefer less heat) and cook for 1 minute, stirring constantly so the garlic doesn't burn.
Stir in the tomato paste and cook for 1 minute to deepen the flavor.
Add the canned whole San Marzano tomatoes with their juices, breaking them up with a spoon or potato masher, then stir in the dried oregano, dried thyme, and salt.
Bring the sauce to a vigorous simmer, then reduce the heat to maintain a gentle simmer and cook, uncovered, for 15–20 minutes, mashing tomatoes occasionally, until the sauce thickens to your liking. Add reserved pasta water a little at a time if you want to thin the sauce.
Stir in the minced fresh basil and parsley, then add the cooked penne to the sauce and toss to combine and heat through.
Taste and adjust seasoning as desired with more red pepper flakes, salt, or a pinch of sugar if you prefer a sweeter sauce. Serve with plenty of freshly grated Pecorino Romano or Parmesan.