Make the crust. For graham cracker crust, stir crumbs, sugar, salt, and melted butter until evenly moistened. Press into a 9-inch pie plate, going up the sides.
Bake at 350°F (175°C) for 8–10 minutes, then cool completely. For pastry crust, blind-bake according to package or recipe instructions, then cool.
Start the custard base. In a medium saucepan off the heat, whisk sugar, cornstarch, and salt. Slowly whisk in the milk until smooth.
Whisk in egg yolks until fully combined.
Cook the custard. Set the pan over medium heat. Cook, whisking constantly, until the mixture thickens and bubbles, 6–9 minutes. Once thick and bubbling, cook for 1 minute more to eliminate any starchy taste.
Finish the custard. Remove from heat.
Whisk in butter and vanilla until glossy. If you want an extra-smooth texture, strain the custard through a fine-mesh sieve into a clean bowl.
Prep the bananas. Slice bananas about 1/4 inch thick. If using lemon juice, lightly toss slices with a small amount to slow browning.
Don’t overdo it or you’ll taste the lemon.
Layer the pie. Spread a thin layer of warm custard onto the cooled crust. Add a layer of banana slices. Top with half the remaining custard, then another layer of bananas, and finish with the rest of the custard.
Smooth the surface.
Chill to set. Press plastic wrap directly onto the custard surface to prevent a skin. Refrigerate for at least 4 hours, ideally overnight, until fully set.
Whip the cream. Beat heavy cream, powdered sugar, and vanilla to soft peaks. Spread or pipe over the chilled pie.
Add garnish if you like.
Slice and serve. Use a sharp knife dipped in hot water and wiped dry for clean slices. Serve chilled.