Make crust: In a medium bowl, mix flour, salt, and pepper. Rub butter into flour until most of it looks like cornmeal but some larger, pea-size pieces remain. Drizzle in 3 tablespoons ice-cold water while stirring quickly with a fork. Or, pulse flour, salt, pepper, and butter in a food processor until a coarse, cornmeal-textured mixture forms, then drizzle in ice water until dough comes together. Turn dough onto a large piece of plastic wrap and use wrap to press dough into a 1-in.-thick disk. Wrap in plastic wrap and refrigerate at least 30 minutes and up to 2 days.
Preheat oven to 375. Lightly flour a work surface. Unwrap dough; with a rolling pin gently roll it, turning dough 90 degrees between each roll, into a 12 inch circle.
Place rolled-out dough in a 9 1/2 inches tart pan. Trim edges flush with pan edges. Cover dough with a large piece of aluminum foil and weigh down with pie weights, dried beans, or uncooked rice.
Bake crust 20 minutes. Lift foil and weights off crust and bake until beginning to turn golden, about 10 minutes. Let crust cool to room temperature.
Meanwhile, make filling: Melt butter in a large frying pan over medium-high heat. Add leeks and salt and cook, stirring, until leeks are soft, about 3 minutes. Turn heat to high and add mushrooms. Cook, stirring constantly, until mushrooms have given off their liquid 5 to 10 minutes. Stir in thyme, cream, and pepper, then turn off heat and let cool to room temperature.
Spread half of the grated cheese over tart crust. Spread leek-mushroom mixture on top and sprinkle with remaining cheese. Bake until cheese is melted and golden, about 25 minutes. Let sit 10 minutes before cutting. Serve warm or at room temperature.