Preheat the oven to 400°F and line two baking sheets with parchment paper.
Unroll the two sheets of puff pastry onto the lined sheets, straight from the refrigerator, and prick each all over with a fork so steam escapes evenly.
Lay a second sheet of parchment over each pastry, set another baking sheet on top to weigh it down, and bake for 20 to 25 minutes, until deep golden and firm when you press the top sheet.
Remove the weights and let the pastry cool completely on a wire rack, about 20 minutes, then trim each sheet into three even rectangles, 9 in total.
For the pastry cream, heat the milk and vanilla extract in a saucepan over medium heat until steaming, not boiling.
In a bowl, whisk the egg yolks, sugar and cornstarch together until pale and thick, about 2 minutes.
Pour one cup of the hot milk slowly into the yolk mixture, whisking constantly, then pour the tempered yolks back into the saucepan with the rest of the milk.
Cook over medium heat, whisking constantly, until the cream thickens to the consistency of pudding and holds a ribbon off the whisk, 3 to 4 minutes.
Remove from the heat, whisk in the cold butter until glossy, then press plastic wrap directly onto the surface and chill for at least 2 hours, until fully set.
Spoon the chilled pastry cream into a piping bag fitted with a round tip.
Set one pastry rectangle on a plate, pipe an even layer of pastry cream over it, top with a second rectangle, pipe another layer, and finish with the third rectangle, cream side down.
Repeat with the remaining rectangles and cream to build two more stacks.
Whisk the powdered sugar with 2 to 3 tablespoons of milk until smooth and pourable, spread over the top of each stack, and drag lines of melted chocolate through the glaze with a toothpick for the marbled finish, if using.
Chill the finished mille-feuille for 15 minutes before slicing with a sharp serrated knife, so the layers stay neat.