Preheat your oven to 350°F (175°C) and butter a 9-inch (23-cm) springform pan. Line the bottom with parchment paper and butter the parchment too. Set aside.
Combine stout and butter in a medium saucepan set over medium heat. Stirring occasionally, keep it like that until the butter completely melts, then remove from heat. Stir in cocoa, sugar, espresso powder and salt, whisk until the mixture is smooth.
Whisk sour cream with eggs and vanilla in another bowl. Next stir in the stout mixture. Lastly add the flour and baking soda and whisk until smooth. The batter can have air bubbles, but no patches of flour. It should be smooth but somewhat thick, like pancake batter.
Pour batter into prepared pan and bake for 45-60 minutes (mine needed only 45 minutes), until the cake is firm and a cake tester inserted into the center comes out clean. Remove cake from the oven, set it on a cooling rack and let it sit like that for 45 minutes. It has to cool in the pan.
To remove the cake from the pan, run a thin knife around the sides of the cake. Remove the ring part of the pan, invert cake on a plate to peel of the parchment paper, then flip the cake back so the bottom part sits on a plate. (At this point you can frost the cake or wrap it into plastic and store it at room temperature for up to 4 days or in the freezer for up to 2 months.)
To make the frosting, first place the mascarpone in a large bowl and gently stir it with a spatula to make it creamy. In another bowl, combine cream with sugar and vanilla. Beat on medium-high speed until soft-to-medium peaks form.
Stir the cream into mascarpone and beat on low speed for 30-60 seconds until the mixture is completely blended. It should be smooth (not grainy!) and fluffy. Spread frosting over cake, add gold leaf or sprinkles if desired and serve.If you’re not serving it right away, keep the cake in the refrigerator. Keep leftover cake covered in the refrigerator as well and eat within 3 days.