Set your oven to 400 degrees Fahrenheit and place the rack in the center. Lightly coat a 9×13 inch baking dish with cooking spray.
Bring a large pot of salted water to a boil and cook the penne for about 10 minutes, ensuring it remains slightly firm to avoid mushiness.
In a skillet, heat the olive oil over medium-high heat, then add the ground beef and chopped onion. Cook for around 10 minutes, breaking the meat apart as it browns. Stir in the minced garlic partway through cooking. Remove some excess fat if necessary.
Add the marinara sauce to the skillet and heat through. Taste and season with salt and pepper as preferred.
Drain the cooked pasta and transfer it to the prepared baking dish. Pour the beef sauce over the pasta and gently mix until evenly combined.
Sprinkle an even layer of shredded cheddar cheese over the casserole. For extra cheesiness, mix in an additional half cup of cheese before topping.
Bake uncovered for 10 minutes until the cheese melts thoroughly. Optionally, switch to the broiler for a few minutes to get a golden, bubbly cheese crust. Serve hot.