Prepare the crust: For a traditional pie crust, fit it into a 9-inch pie dish, prick the bottom with a fork, line with parchment, and fill with pie weights. Bake at 375°F (190°C) for 15 minutes, remove weights, and bake 10–12 more minutes until golden. Let cool completely. For a graham crust, mix crumbs, sugar, and melted butter, press into dish, and bake at 350°F (175°C) for 8–10 minutes. Cool.
Make the custard: In a saucepan, whisk sugar, cornstarch, and salt. Add milk gradually, whisking until smooth. In a separate bowl, whisk egg yolks. Warm the milk mixture over medium heat, stirring, until steaming.
Thicken the custard: Slowly pour about 1/2 cup of the hot milk mixture into the yolks while whisking (to temper), then pour the yolk mixture back into the saucepan. Cook over medium heat, whisking constantly, until thick and bubbly, 2–4 minutes. Once it starts to bubble, cook 1 more minute to set the cornstarch.
Finish the custard: Remove from heat. Whisk in butter and vanilla. Press custard through a fine-mesh sieve into a bowl to catch any lumps. Press plastic wrap directly on the surface and let cool to room temperature. Refrigerate until cool, about 1–2 hours.
Slice the bananas: Cut bananas into 1/4-inch rounds. If desired, toss lightly with lemon juice to reduce browning, then pat dry.
Assemble the pie: Spread a thin layer of custard over the cooled crust. Arrange a layer of banana slices evenly over the custard. Top with half the remaining custard, add another layer of bananas, and finish with the rest of the custard. Smooth the top. Cover and chill at least 4 hours, preferably overnight, until fully set.
Whip the cream: Beat cold cream, powdered sugar, and vanilla to soft peaks. Spread or pipe over the chilled pie.
Garnish and serve: Add shaved chocolate, crushed wafers, or toasted coconut if you like. Slice with a sharp knife, wiping between cuts for clean slices.