In a large bowl, whisk together your all-purpose flour, sugar and salt. If using a food processor, pulse a few times to combine.
Add your cold butter pieces to the flour mixture. Use a pastry cutter or your fingertips to work the butter into the flour until you have coarse crumbs, like small peas.
Add your active sourdough starter (or sourdough discard) and toss gently with a fork or bench scraper until the dough starts to come together. You want the dough to hold together when pinched but not be sticky.
On a lightly floured work surface, gather the dough into a rough ball. Use your bench scraper to fold it over itself a few times.
Divide the pastry dough in half for a double-crust pie (one bottom crust and one top crust) or leave it whole for a single pie crust.
Wrap each portion tightly in a piece of plastic wrap or slide into a freezer bag. Chill for at least 1 hour, or up to 3 days.
When ready to bake, let the wrapped dough rest at room temperature for 5–10 minutes so it softens slightly. On a floured surface, roll the dough into a 12-inch circle. Use quarter turns as you roll to prevent sticking. Transfer to your pie plate or pie pan, gently pressing into the bottom and sides.
Trim any excess dough, fold edges under, and crimp as desired.
Brush with egg wash for glossy finish (optional)
If you’re baking a pie with filling that bakes along with the crust (like apple pie, chicken pot pie, or any double-crust pie), follow the baking directions for that recipe.