Place the egg yolk in a small bowl, pour in 2 tablespoons of ice water, and stir to combine. If you don't want to use the egg yolk, save the ice water to add to the dry ingredients.
In a large bowl or bowl of a stand mixer, whisk together the gluten free flour, sugar, and salt. Using a hand mixer or stand mixer, add half of the cold butter to the flour mixture and beat on low for about 1 minute. Add the rest of the butter and beat it until the butter breaks down and is incorporated into the flour. Then, use your hands to rub and mix in the butter a bit more. The pieces of butter should be the size of peas.
On low speed, beat in the egg yolk mixture or 3 tablespoons of ice water until the dough comes together. Add a little more ice water if the dough is dry.
Gather up the dough and place it on a work surface lightly floured with gluten free flour. Flatten it in a square, including any loose pieces, then gently fold the dough over onto itself and flatten it again. Repeat the folding process 3-4 more times until the dough is smooth without any loose pieces remaining.
Flatten the dough into a 6-inch disc, wrap it in plastic wrap, and place it in the fridge for at least 30 minutes and up to 2 days.
To Make Dough By Hand
In a large bowl, whisk the dry ingredients. Cut in the butter using a pastry cutter, fork, or your hands. Work in the butter until it starts to break down and resemble small peas. Stir in the egg yolk mixture or add ice water until the dough begins to hold together. Then turn it out onto a floured surface and continue the folding process.
Notes
Keep the butter cold. One secret to ultra-flaky pastry dough is to keep the butter cold. This will create streaks and clumps of butter in the dough - and that's a good thing! When you bake the crust, the butter will melt in the oven, creating gaps in the dough. Steam also releases during the baking process, making those lovely flaky layers.
Add the ice water slowly. You want just enough ice water to bring the dough together but you don't want to over-hydrate the dough (even though it's a gluten free dough). You'll get the hang of this the more you make pie dough, but a good rule to follow is to continue to slowly add water 1 tablespoon at a time until you don't see any dry bits of flour without the flour becoming saturated. The dough will hold together when you squeeze it together in a ball, and won't have any bits falling off on the sides.
Rest the dough. As with all gluten free baking recipes, you should rest your pie dough in the fridge. (This applies to regular pie dough as well!) As mentioned, you should leave at least 30 minutes for the dough to chill in the fridge, and preferably even more (hours, or even a few days). The colder the dough, the easier it will be to roll it out and the dough won't be sticky.
Use oat flour on the counter. When you are ready to roll out your dough, sprinkle the counter liberally with oat flour. You can also roll the dough out between two pieces of plastic wrap or parchment paper sprinkled with oat flour. This will help keep the crust from sticking.
Don't roll it out too thin. This is a sturdy dough, but take care not to roll it out overly thin or it may break when you place it in the pie pan.
Do a vegan version. You can easily make this recipe vegan by using your favorite non-dairy butter for the butter. Or, try coconut oil or olive oil. If you use an oil, place it in the fridge to chill before adding it to the dough. And, don't use the egg yolk.