Preheat an oven to 350F.
Butter a 8x3-inch cake pan, then dust with flour, tapping out excess. Line a baking sheet with parchment paper, then place the 4 bananas, whole and unpeeled, on top. Bake until the skin is deeply blackened on both sides, but not split, 20 to 30 minutes. Flip once during baking and add the walnuts to the tray for the last 10 minutes of roasting (if the bananas release a lot of liquid, give the nuts their own tray or use a small skillet).
While the bananas are roasting, stir the oats, sour cream and vanilla together in a medium bowl. Set aside to soften.
Once the bananas are roasted let stand until cool enough to handle. Slit the skins and release the fruit into the bowl with the oats. With a fork or back of a spoon, mash the banana, and fold into the softened oats. Keep to the side with the walnuts on the tray while you make the cake batter.
In a small bowl, whisk together the flours, coffee, baking soda and salt.
Attach the beater to a stand mixer. Cream the butter and sugar together on medium high until lightened in colour and fluffed, about 5 minutes. Periodically scrape down the bowl and beater as you mix. Turn the speed down to medium, and add the eggs, one at a time and beating well after each addition. Scrape down the bowl and beater before adding the second egg. If the mixture looks curdled, it may be that the egg was too cold; increase the speed to medium-high and beat until smooth.
With the mixer on stir, spoon in half the dry ingredients. Once almost incorporated, scrape in the banana mixture. Let the machine run until the bananas are mostly mixed in, then follow with the rest of the dry ingredients. Remove the bowl, scrape the beater, and give the batter a few stirs by hand, making sure to get to the bottom of the bowl.
Tip the batter into the prepared pan. Crush the walnuts lightly in your hands, and sprinkle on top. Strew the chocolate over next, and raw sugar, if using. Bake in the hot oven until well risen, and a cake tester inserted in the centre comes out clean (chocolate doesn’t count), around 70 minutes.
Cool completely in its pan, set on a baking rack. The cake can be stored under a dome at room temperature for up to 2 days. It freezes beautifully.
Makes an 8-inch cake.