First, cook the 1 package gluten free pasta according to the package directions, then set aside in a large bowl.
Preheat the oven to 350℉ and butter or grease a 9x13-inch baking pan.
In a large saucepan over medium heat, melt the ¼ cup unsalted butter. Whisk in the ¼ cup sweet white rice flour and cook for about 2 minutes, whisking, until a paste forms. Whisk in the 1 cup whole milk, whisking constantly, until smooth, then whisk in the 1 ½ cups 2% milk until a smooth sauce forms. Cook, whisking often, until a thick sauce forms, about 5 minutes.
Remove the sauce from the heat and stir in 1 cup of the 2 cups shredded cheddar cheese and ½ cup of the 1 cup shredded mozzarella cheese until melted. Stir in the ½ teaspoon fine sea salt, ½ teaspoon black pepper, and 1 teaspoon Dijon mustard if using.
Pour the cheese sauce onto the pasta in the bowl, and mix so that the pasta is coated with sauce. Spread half the pasta mixture in the prepared pan, then sprinkle with 1 cup cheddar cheese and the remaining mozzarella cheese. Top with the remaining pasta mixture. Finish with the remaining ½ cup of cheddar cheese and sprinkle the top with ½ cup shredded parmesan cheese if desired.
Place in the oven and bake for about 20 minutes, until the cheese is melted and the sauce is bubbling. Remove from the oven and let rest for 5-10 minutes before serving.
Notes
Don't overcook the pasta. Follow the instructions on your box of pasta, then cook for about 1-2 minutes less time so that the pasta is al dente (slightly firm). It will soften in the oven as it bakes and soaks up the cheese sauce.
Let it rest. Allow the baked mac and cheese to rest for about 5-10 minutes after it comes out of the oven so that it is not overly goopy.
Try different pasta shapes. As noted, you can use any kind of pasta shape here, though I prefer tubed or shaped "nooks and crannies" pasta like penne, ziti, or macaroni to really get in there with the cheese sauce.
Add gluten-free breadcrumbs. A lot of people like baked mac and cheese finished with a layer of crisp breadcrumbs! If that's you, mix 4 tablespoons of melted butter with ¼ cup of gluten-free breadcrumbs, then spread this mixture over the top of the pan of pasta.
Play around with the cheese. These are my favorite cheeses to use, but feel free to try others. Gruyere is nice, and pepper or regular jack cheese will add a mellow smoothness.