Heat the oven to 400 degrees Fahrenheit and position the rack in the center. Lightly spray a 9x13 inch baking dish with cooking spray.
Bring a large pot of salted water to a boil and cook the penne for about 10 minutes until it’s just under al dente to prevent mushiness.
In a skillet over medium-high heat, warm the olive oil, then add the ground beef and chopped onion. Cook for around 10 minutes, breaking the meat apart as it browns. Add the minced garlic halfway through and cook until fragrant. Remove excess fat if necessary.
Pour in the marinara sauce and stir until heated thoroughly. Season with salt and pepper according to your taste.
Drain the pasta and transfer it to the prepared baking dish. Pour the beef and sauce mixture over the pasta and mix gently to combine.
Sprinkle an even layer of shredded cheddar cheese on top. For extra cheesiness, mix in half a cup of cheese into the pasta before adding the rest on top.
Bake uncovered for 10 minutes until the cheese melts nicely. For a golden-brown finish, broil the casserole for a couple of minutes if desired. Serve hot right away.