Preheat your oven to 350°F (175°C). Grease and line a 9×5-inch loaf pan with parchment paper, leaving some overhang on the sides for easy removal.
In a medium bowl, whisk together the flour, cocoa powder, baking powder, baking soda, and salt. Set aside.
In a large mixing bowl, cream the softened butter and granulated sugar together until light and fluffy.
Add the eggs, one at a time, beating well after each addition. Stir in the vanilla extract.
Gradually add the dry ingredients to the wet ingredients in the large mixing bowl, alternating with the buttermilk. Begin and end with the dry ingredients. Mix until just combined. Do not overmix.
If using, fold in the chocolate chips or chunks.
Pour the batter into the prepared loaf pan and smooth the top.
Bake in the preheated oven for 50-60 minutes, or until a toothpick inserted into the center comes out clean or with a few moist crumbs.
Remove the cake from the oven and allow it to cool in the pan for about 10 minutes. Then, using the parchment paper overhang, lift the cake out of the pan and transfer it to a wire rack to cool completely.
Once the cake has cooled, you can dust the top with powdered sugar for an extra touch.
Slice and serve the delicious chocolate loaf cake on its own or with a dollop of whipped cream or a scoop of ice cream, if desired.