Whisk sugar, cornstarch, and salt together in a medium saucepan.
Gradually whisk in the milk until completely smooth.
In a separate bowl, whisk the egg yolks.
Slowly whisk a small amount of the warm milk mixture into the egg yolks.
Pour the egg mixture back into the saucepan while whisking.
Cook over medium heat, stirring constantly, until the mixture thickens into a smooth pudding.
Remove from heat and stir in the butter and vanilla extract.
Let the pudding cool slightly.
Slice the bananas into thin, even pieces.
Beat the heavy cream and powdered sugar until soft peaks form.
Arrange a layer of vanilla wafers in the bottom of a serving or trifle dish.
Add a layer of sliced bananas.
Spread a layer of vanilla pudding over the bananas.
Repeat the layers until all the pudding, bananas, and cookies have been used.
Spread the whipped cream evenly over the top.
Cover the dish and refrigerate for at least 2 hours.
Garnish with fresh banana slices and vanilla wafers just before serving.