Prepare the Pudding:
In a medium saucepan, whisk together sugar, flour, and salt. Gradually whisk in milk until smooth. Cook over medium heat, stirring constantly, until mixture thickens and begins to bubble.
Add Egg Yolks:
Temper the egg yolks by slowly whisking in about 1/2 cup of the hot pudding mixture. Then add the tempered yolks back into the saucepan. Continue to cook for 2–3 minutes, stirring constantly. Remove from heat.
Add Butter and Vanilla:
Stir in butter and vanilla extract until smooth. Let the pudding cool slightly.
Whip the Cream:
In a separate bowl, whip the heavy cream with powdered sugar and vanilla extract until stiff peaks form.
Assemble the Banana Pudding:
In a large trifle dish or individual serving cups, layer vanilla wafers, banana slices, and pudding. Repeat layers until all ingredients are used, ending with a layer of pudding.
Top with Whipped Cream:
Spread whipped cream over the top layer of pudding. Garnish with additional banana slices or crushed vanilla wafers if desired.
Chill:
Refrigerate for at least 4 hours or overnight to allow flavors to meld and the wafers to soften slightly.