Preheat oven to 375°F (190°C).
Bring a large pot of salted water to a boil. Cook the penne pasta until al dente. Drain and set aside.
Heat olive oil in a skillet over medium heat. Add the chopped onion and cook until soft.
Add minced garlic and cook for 30 seconds until fragrant.
Add ground beef to the skillet. Cook until browned, breaking it apart as it cooks. Season with salt and black pepper.
Stir in the marinara sauce and simmer for 3–5 minutes.
Place cooked pasta into a baking dish. Spoon the beef mixture evenly over the pasta.
Sprinkle shredded cheddar cheese over the top.
Bake for 20–25 minutes, until the cheese is melted and bubbly.
Remove from the oven, let rest for a few minutes, garnish if desired, and serve warm.