Cook the Pasta: Bring a large pot of salted water to a boil. Add spaghetti and cook until al dente, about 9-10 minutes. Before draining, reserve ½ cup of pasta water. Drain the pasta and set aside, ensuring it doesn't stick together.
Brown the Beef: Heat a large deep skillet over medium-high heat. Add 1 tablespoon of butter and olive oil if needed. Add ground beef and cook for 5-7 minutes, breaking it into smaller pieces with a spatula until thoroughly browned. Drain excess grease to prevent a greasy sauce.
Add Aromatics: Add the diced onion to the skillet with the beef and cook for 3-4 minutes until the onion becomes translucent and softened. Add minced garlic and cook for about 30 seconds until fragrant, being careful not to burn the garlic.
Season the Mixture: Add the remaining 2 tablespoons of butter, Italian seasoning, garlic powder, onion powder, salt, pepper, and red pepper flakes if using. Stir for about 1 minute to ensure the beef gets completely coated in the flavorful garlic butter mixture.
Create the Sauce Base: Pour in the heavy cream and beef broth (or reserved pasta water). Stir well, scraping any flavorful bits from the bottom of the pan. Let the mixture simmer for 3-4 minutes until it begins to thicken slightly.
Add Cheese: Reduce heat to low to prevent the cheese from separating. Gradually add the shredded cheddar cheese, incorporating a handful at a time while stirring continuously until completely melted. Then add the Parmesan cheese and continue stirring until the sauce is smooth and creamy. If the sauce becomes too thick, add a splash of reserved pasta water to adjust consistency.
Combine with Pasta: Add the cooked spaghetti to the skillet with the sauce. Using tongs, gently toss for 2-3 minutes until every strand of pasta is thoroughly coated in the cheesy garlic butter sauce. Ensure even distribution of the beef and sauce throughout the pasta.
Rest and Serve: Remove the skillet from heat and let the dish rest for a couple of minutes. This allows the sauce to thicken slightly and cling better to the pasta. Serve warm, garnished with chopped parsley or green onions if desired.