Prepare the dough: Combine flour, sugar, and salt in a large bowl. Add cubed butter and use a pastry cutter or your fingers to mix until the mixture resembles coarse crumbs. Add egg yolks, vanilla, and water, and mix until dough comes together. Wrap in plastic and chill for 30 minutes.
- Make the pastry cream: Heat milk in a saucepan until steaming. In a separate bowl, whisk together sugar, egg yolks, and cornstarch. Gradually pour in hot milk, whisking constantly, then return to the saucepan and cook until thickened. Stir in vanilla and butter. Let cool, then refrigerate until needed.
- Assemble the Gâteau Basque: Preheat oven to 375°F (190°C). Grease a 9-inch cake pan and line with parchment paper. Roll out half of the chilled dough and press it into the pan, covering the bottom and sides. Spread a thin layer of cherry jam (if using) and then top with pastry cream.
- Top the cake: Roll out the second portion of dough and cover the cream. Seal the edges and brush the top with the beaten egg wash. Decorate the top with a fork or a light score pattern.
- Bake the cake: Bake for 30-35 minutes or until the top is golden brown and the filling is set. Let cool for 10 minutes, then transfer to a wire rack to cool completely.
- Serve: Once cooled, slice the Gâteau Basque and serve, either on its own or with whipped cream or fresh berries.