Prepare your pie crust according to package instructions if you are not using a pre-baked one. Allow it to cool completely if freshly baked.
In a medium saucepan, combine the sugar, cornstarch, and salt. Whisk together.
Gradually pour in the milk while whisking to combine. Add the egg yolks and stir to mix well.
Cook the mixture over medium heat, stirring constantly, until it thickens and starts to bubble. This should take about 8-10 minutes.
Once thickened, remove the saucepan from heat and stir in the butter and vanilla extract until the butter is fully melted and incorporated.
Allow the custard to cool for about 5 minutes, then gently fold in the sliced bananas.
Pour the banana custard mixture into the prepared pie crust, smoothing it out evenly.
Cover the pie with plastic wrap and refrigerate for at least 2 hours (or until set).
Before serving, whip the heavy cream with powdered sugar until soft peaks form.
Spread or pipe the whipped cream over the top of the chilled pie. Garnish with additional banana slices if desired.
Slice the pie and serve immediately.