Preheat your oven to 350°F (175°C). Grease an 8x8-inch baking dish or line it with parchment paper for easy removal.
In a large mixing bowl, combine the mashed bananas, melted butter, and vanilla extract. Mix until well combined.
In another bowl, whisk together the flour, rolled oats, brown sugar, granulated sugar, baking powder, cinnamon, and salt.
Gradually add the dry ingredients to the banana mixture, stirring until just combined. If using, fold in the chopped walnuts or pecans.
Pour the batter into the prepared baking dish, spreading it evenly.
Bake in the preheated oven for 30-35 minutes, or until the top is golden brown and a toothpick inserted in the center comes out clean.
Allow to cool for at least 10 minutes before slicing into squares and serving.