01 - Whisk together flour, cocoa powder, powdered sugar, and salt in a large bowl. Add cold butter and rub with fingertips until mixture resembles coarse crumbs. Add egg yolk and 2 tablespoons cold water, mixing just until dough comes together, adding more water 1 teaspoon at a time if needed. Shape into a disk, wrap in plastic, and chill for at least 30 minutes.
02 - Roll out dough on a lightly floured surface to fit a 9-inch tart pan. Press into pan, trim excess, and prick base with a fork. Freeze for 15 minutes. Preheat oven to 350°F. Line crust with parchment and fill with pie weights. Bake for 15 minutes, remove weights and parchment, and bake 8-10 minutes more until set. Cool completely.
03 - Heat milk and vanilla bean or extract in a medium saucepan over medium heat until just simmering. Whisk egg yolks, sugar, and cornstarch in a bowl until pale and smooth. Slowly pour hot milk into egg mixture while whisking constantly. Return mixture to saucepan and cook over medium heat, whisking constantly, until thickened and bubbling for 2-3 minutes. Remove from heat and whisk in butter until smooth.
04 - Transfer pastry cream to a bowl and press plastic wrap directly onto surface. Chill until cold, about 1 hour.
05 - Spread chilled pastry cream evenly into cooled tart shell. Arrange raspberries on top in concentric circles. Optionally warm raspberry jam and brush over berries for a glossy finish. Optionally drizzle melted chocolate over the top. Chill tart for at least 30 minutes before slicing and serving.