Preheat Oven: Preheat your oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan or two 8-inch round cake pans, or line them with parchment paper.
Mix Dry Ingredients: In a bowl, sift together flour, cocoa powder, baking powder, baking soda, and salt.
Cream Butter and Sugar: In a large mixing bowl, beat together softened butter and sugar until light and fluffy.
Add Eggs: Mix in the eggs one at a time, beating well after each addition.
Combine Bananas and Vanilla: Stir in mashed bananas and vanilla extract.
Incorporate Dry Ingredients: Gradually add the dry ingredients to the banana mixture, alternating with buttermilk, starting and ending with the dry ingredients. Mix until just combined.
Bake: Pour the batter into the prepared pan(s). Bake for 50-60 minutes, or until a toothpick inserted into the center comes out clean.
Cool: Let the cake cool in the pan for 10 minutes, then transfer to a cooling rack to cool completely.
Frost (Optional): If desired, beat together butter, cocoa powder, powdered sugar, milk, and vanilla extract until smooth. Spread over the cooled cake.