Preheat the oven to 350°F (175°C). Grease a 9x5-inch loaf pan and line with parchment paper, leaving an overhang on the two long sides.
Whisk together the flour, baking powder, and salt. Set aside.
Using an electric mixer on medium speed, beat the butter and sugar until light and fluffy (about 3 minutes).
Add the eggs one at a time, mixing well after each addition. Mix in the vanilla.
With the mixer on low speed, add the flour mixture in three portions, alternating with two portions of sour cream. Mix just until combined.
Transfer about a third of the batter to a separate bowl.
Stir together the cocoa powder, hot water (plus optional espresso powder) or hot coffee. Mix into the smaller portion of batter until combined.
Spread about half of the vanilla batter into the prepared pan. Dollop half of the chocolate batter over the top, and swirl very gently.
Add the remaining vanilla batter, followed by the remaining chocolate batter. Use a thin knife or skewer to make a few figure-eight swirls through the batter.
Sprinkle the top with coarse sugar, if using.
Bake 50 to 60 minutes, or until a pick inserted into the center comes out with just a few moist crumbs. Don't over-bake.
Cool in the pan for 15 minutes. Then use the parchment to lift the cake from the pan and transfer to a wire rack. to cool completely.
Notes
For the best texture, bring the eggs and sour cream to room temperature before mixing.
Coffee deepens the chocolate flavor without making the cake taste like coffee. If using hot water instead, add the optional espresso powder for a similar flavor boost.
Swirl the batters only a few times so they stay distinct. Too much swirling will muddy the marble pattern.
Be careful not to over-bake. Start checking the cake around 50 minutes and remove it from the oven when a pick inserted into the center comes out with just a few moist crumbs.
Store in an airtight container at room temperature up to 3 days.