Preheat your oven to 350°F (177°C). Grease two 9-inch round cake pans and line the bottoms with parchment paper, then grease the paper.
In a large bowl, sift together the cake flour, baking powder, and salt. Set aside.
In a stand or hand mixer, beat the softened butter until smooth. Add both sugars and beat on high until fluffy (3–4 minutes). Scrape the bowl as needed.
Reduce speed to low and add the eggs one at a time, followed by the yolks. Add vanilla extract, then beat on medium-high until fully incorporated.
With the mixer on low, add dry ingredients in three parts alternating with the buttermilk. Mix until just combined. Do not overmix. Use a whisk if needed to smooth any lumps.
Transfer 1 cup of the batter to a separate bowl. Melt the chopped chocolate in the microwave, stirring every 20 seconds. Mix with reserved batter until smooth.
Divide vanilla batter between pans. Spoon chocolate batter over each. Add remaining vanilla batter. Swirl gently with a knife or skewer.
Bake for 22–27 minutes. Check doneness with a toothpick—look for a few moist crumbs. Let cakes cool in pans on a wire rack.
To make frosting, beat softened butter on high until creamy. Add sugar, cocoa, salt, vanilla, and cream. Mix on low, then whip on high for 3 minutes. Adjust with more cream or sugar if needed.
If needed, level the cake layers. Place one on a stand, spread ¾ cup frosting on top, add second layer, and frost entire cake. Decorate with sprinkles if desired.