Preheat the oven to 375°F. If using an unbaked crust, blind bake the 9-inch pie crust for 12–15 minutes until golden. Let cool completely.
In a medium saucepan, whisk together sugar, cornstarch and salt until combined.
In a separate bowl, lightly beat the egg yolks. Gradually whisk about 1 cup of the cold milk into the yolks to temper, then pour yolk mixture back into the saucepan.
Whisk in the remaining milk and place the saucepan over medium heat. Cook, whisking constantly, until the mixture thickens and comes to a simmer, about 6–8 minutes.
Remove from heat and stir in butter and vanilla until smooth. Pour the pastry cream into a bowl, press plastic wrap directly onto the surface to prevent a skin, and cool to room temperature, then chill until cold.
Slice bananas and layer half the slices over the bottom of the cooled pie crust.
Pour the chilled pastry cream over the bananas, smoothing the top. Arrange remaining banana slices on top of the filling as desired. Chill the pie in the refrigerator for at least 4 hours to set.
Just before serving, whip the heavy cream with powdered sugar and vanilla until soft peaks form. Spread or pipe the whipped cream over the pie and garnish with extra banana slices if you like.
Slice and serve chilled. Store leftovers covered in the refrigerator for up to 2 days.
Notes
For best texture, chill the pie thoroughly before serving. Use ripe but firm bananas to prevent browning.