Cook the cavatappi pasta according to the package instructions until it's al dente. Drain and set aside.
In a large skillet, cook the chopped bacon over medium heat until it becomes crispy. Remove the bacon from the skillet and place it on a paper towel-lined plate to drain.
In the same skillet with the bacon drippings, add the chopped onion and minced garlic. Sauté until they become fragrant and the onion is translucent.
Add the butter to the skillet and allow it to melt. Sprinkle the flour over the onion and garlic mixture. Stir and cook for a couple of minutes to create a roux
Reduce the heat to low and stir in the shredded cheddar cheese. Continue to stir until the cheese is fully melted and the sauce is smooth.
Add the cooked cavatappi pasta to the cheese sauce. Mix until the pasta is well coated with the creamy cheese sauce.