Preheat the oven to 180℃ (160℃ fan/350℉). Grease a 23 cm (9-inch) cake tin with butter or oil, then line the bottom and sides with parchment paper.
To a saucepan, add the chocolate, sugar, and Guinness. Set over low-medium heat and bring to a gentle simmer. Cook, stirring frequently, until the chocolate has melted and the sugar has fully dissolved.
Remove the saucepan from the heat and sift in the cocoa powder. Whisk together until smooth, then set aside to cool for 15-20 minutes.
Whisk together the flour, baking soda, baking powder, and salt, and set aside.
Pour the cooled chocolate mixture into a large mixing bowl. Add the oil and whisk until smooth and shiny. Add the sour cream, eggs, and vanilla, and whisk to combine.
Gradually add the dry ingredients to the wet, being careful not to over-mix.
Pour the batter into the prepared cake tin and give it a couple taps on the countertop to release any large air bubbles. Bake on the middle rack for 45-55 minutes, or until a toothpick inserted into the centre comes out with just a few moist crumbs. A slight dip in the centre of the cake is normal (see note 5).
Allow the cake to cool in the tin for 15 minutes, then carefully remove and transfer to a wire rack. Make sure it's completely cool before icing with buttercream.