For the pan: Bring a pot of water to a boil. Add the pasta and cook until al dente according to the package instructions.
Butter the bottom and sides of a 9-by-9-inch baking dish or aluminum pan. Add the cooked pasta.
Preheat the oven to 350 degrees F.
For the sauce: In a large pot over medium heat, add the butter and heat until melted. Add the flour and cook, stirring, until the mixture smells like popcorn, about 5 minutes. Slowly add the milk, stirring or whisking while adding. Taste and season the pot with salt and pepper. Add the cheese cubes and stir until melted.
Pour the sauce over the pasta and gently shake the baking dish to settle the sauce in the nooks and crannies. Top with the shredded Cheddar and bake until the corners are brown, 25 to 30 minutes.