01 - Preheat oven to 350°F. Grease and flour a 9x5-inch loaf pan or line it with parchment paper.
02 - In a medium bowl, whisk together flour, cocoa powder, baking soda, and salt.
03 - In a large bowl, mash bananas. Add melted butter, sugar, eggs, and vanilla extract, then whisk until combined.
04 - Gently fold the dry mixture into the wet ingredients until just blended, avoiding overmixing.
05 - Fold in chocolate chips and walnuts if using.
06 - Pour batter into prepared loaf pan, smoothing the surface. Bake 50 to 60 minutes, or until a toothpick inserted in the center comes out with moist crumbs.
07 - Allow to cool in the pan for 10 minutes. Transfer to a wire rack to cool completely before slicing.