Set your oven to 400 degrees Fahrenheit and position the rack in the center. Lightly spray a 9×13 inch baking dish with cooking spray.
Fill a large pot with salted water and bring to a boil for the penne. Cook the pasta for about 10 minutes so it is just shy of fully cooked to prevent it from becoming mushy.
Heat the olive oil in a skillet over medium-high heat, then add the ground beef and chopped onion. Cook while breaking up the meat for around 10 minutes. Add the minced garlic once the beef begins to brown, and drain off excess fat if necessary.
Pour in the marinara sauce and let it warm through. Season with salt and pepper after tasting.
Drain the pasta and transfer it into the prepared baking dish. Pour the beef mixture over the pasta and stir to combine everything well. Sprinkle a layer of cheddar cheese evenly on top. For an extra cheesy dish, mix in half a cup of cheese before topping with the rest.
Place the casserole in the oven and bake for 10 minutes uncovered until the cheese melts beautifully. Optionally, broil the casserole for a few minutes to achieve a golden brown cheese crust. Serve hot.