Preheat the oven to 180C Fan. Grease and line a 900g (2lb) loaf tin with non-stick baking paper or use a little butter and a dusting of cocoa powder.
Place the grated courgette in a clean tea towel and give it a good squeeze to get rid of any excess moisture.
Tip the courgette into a large mixing bowl. Add the sugars, eggs, yoghurt and oil and mix well.
Sieve in the flour, bicarbonate of soda, baking powder and cocoa powder. Add the salt and mix well to combine.
Stir in the chopped chocolate until evenly distributed throughout the batter.
Pour into the prepared loaf tin and bake for about 40-45 minutes - or until a skewer inserted into the centre comes out clean. Check at 35 minutes as ovens vary and you don't want it to be too dry - cover with foil if the top is darkening too quickly.
If frosting, leave to cool in the tin for 15 minutes before turning out onto a wire rack to finish cooling completely. Alternatively, leave to cool in the tin for 5 minutes until just cool enough to handle carefully. Turn out onto a plate and enjoy warm slices with melting pools of chocolate.
If making the frosting: using an electric whisk, beat the butter for about 2 minutes until creamy and fluffy. Add the sour cream and the cooled melted chocolate and continue beating until combined. Sift in the icing sugar and cocoa powder and mix until light and fluffy.
Once the loaf has completely cooled, use a palette knife, spatula or the back of the spoon to spread over the top.
Cut into slices and enjoy!