Start the pudding so it can cool: Set a medium bowl inside a larger bowl filled with a few inches of ice water (ice bath) and place a fine-mesh strainer over the inner bowl. Lightly whisk the egg yolks in a separate medium bowl until smooth.
In a medium saucepan, whisk together the sugar and cornstarch, then slowly whisk in the milk until no lumps remain. Cook over medium heat, whisking constantly, until the mixture steams and thickens to a gentle simmer, 4–6 minutes. Temper the yolks by slowly streaming in about 1 cup of the hot milk mixture while whisking the yolks, then return everything to the saucepan.
Continue whisking over medium heat until the pudding bubbles and is glossy and thick, 45–60 seconds more. Remove from heat, add the chopped chocolate and butter, and whisk until completely smooth. Stir in the vanilla (and bourbon, if using). Strain the pudding into the bowl set over the ice bath, stir occasionally until just warm to the touch, then press plastic wrap directly onto the surface and refrigerate while you bake the crust and brownie.
Preheat the oven to 350°F (177°C). Line the bottom of a 9-inch springform pan with parchment and lightly grease the sides.
Make the crust: In a bowl, combine Oreo crumbs, melted butter, and a pinch of salt until the texture resembles wet sand. Press firmly into the bottom and 1 inch up the sides of the pan. Bake for 8 minutes, then reduce the oven temperature to 325°F (163°C).
Mix the brownie base: Sift the flour, cocoa, baking powder, salt, and espresso powder together. In a separate large bowl, whisk the sugar, eggs, and yolk vigorously until slightly thickened and lighter in color, about 1 minute. Stream in the oil and melted butter while whisking, then whisk in the vanilla. Fold the dry mixture into the wet just until no dry spots remain; do not overmix.
Bake the brownie layer: Scrape the batter into the warm crust, smooth the top, and tap the pan once on the counter to level. Bake at 325°F for 35–45 minutes, until the top is shiny and a toothpick inserted 2 inches from the edge comes out with moist, fudgy crumbs (the center will be soft). Cool on a rack for 45–60 minutes, then refrigerate for 20 minutes to firm the surface.
Assemble: Stir the chilled pudding until smooth and spoon it over the brownie layer. Spread into an even layer and gently tap the pan to release any air pockets. Press plastic wrap directly against the pudding and refrigerate until fully set, 3–4 hours or overnight.
Finish and serve: Run a thin knife around the pan, release the springform ring, and transfer the pie to a serving plate. Whip the cold cream with powdered sugar and vanilla to medium-stiff peaks and mound it over the pudding with soft swirls. Dust lightly with cocoa if desired. Slice and serve chilled.