Melt the butter in a medium-sized saucepan over medium-high heat.
Whisk the rice flour, salt, and pepper into one cup of cold milk. Whisk this mixture into the melted butter. Continue stirring as you add the cream or remaining milk and until the mixture thickens.
Assembling the Dish
Preheat oven to 425°F.
Butter the bottom and sides of a 1 1/2-quart (1.4 L) casserole dish or baking pan.
Layer one-third of the sliced potatoes into the buttered dish. Cover with half of the chopped onions. Pour one-third of the sauce over this.Layer on another third of potatoes, remaining onions, and one-third of sauce.Add remaining potatoes, pouring remaining sauce over all.
Top with shredded cheese.
Sprinkle generously with smoked paprika.
Bake 45 minutes to an hour, or until potatoes feel soft when gently poked with a knife.