Preheat the oven to 375°F and grease a 9x13-inch baking dish.
Cook the cavatappi pasta in a large pot of salted water according to package instructions until al dente. Drain the pasta and set it aside.
In a large saucepan, melt 2 tablespoons of butter over medium heat. Add the diced onion and cook until softened, about 5 minutes.
Add the minced garlic to the saucepan and cook for an additional 1-2 minutes until fragrant.
Whisk in the flour, smoked paprika, salt, and black pepper. Cook, stirring constantly, for 1-2 minutes to remove the raw flour taste.
Gradually whisk in the whole milk and heavy cream, stirring constantly to prevent lumps. Bring the mixture to a simmer, stirring frequently, until thickened, about 5 minutes.
Reduce the heat to low and stir in the shredded cheddar cheese and cubed cream cheese until melted and smooth.
Remove the saucepan from the heat and fold in the cooked cavatappi pasta and drained pimento peppers until well combined.
Transfer the mac and cheese mixture to the prepared baking dish, spreading it out evenly.
In a small bowl, combine the crushed Ritz crackers and 2 tablespoons of melted butter. Sprinkle the cracker mixture evenly over the top of the mac and cheese.
Bake the mac and cheese for 20-25 minutes, or until the top is golden brown and the edges are bubbly.
Remove from the oven and let cool for 5-10 minutes before serving.