Preheat oven to 350 degrees F. Lightly grease the bottom of two 9" round cake pans, then place a parchment paper round in the bottom of each pan. Spray the pan once more liberally with cooking spray and set aside.
In the bowl of a stand mixer, cream together the butter and granulated sugar with a paddle attachment until creamy and pale yellow in color, about 3 to 4 minutes, stopping to scrape the sides of the bowl if needed. Add in the eggs, one at a time, beating well after each addition, followed by the egg yolks, one at a time, and then the vanilla extract. Scrape sides of bowl if needed.
Whisk together the baking powder, salt, and flour in a medium bowl. Alternate adding in some of the flour mixture, mixing well, and streaming in some of the buttermilk, mixing well, ending with the flour mixture until just combined. Portion the batter evenly among the cake pans.
Bake for 25-30 minutes, checking at the 25 minute mark and testing the cake's doneness with a wooden toothpick or cake tester. The cake tester should come out with moist crumbs, but not wet batter. Cool the cakes completely at room temperature.
For the frosting: Beat together the butter and cocoa powder slowly until combined and creamy, 2 minutes. Add in the confectioners' sugar, one cup at a time, alternating with little bits of the heavy cream and vanilla until frosting is light, fluffy, and spreadable.
Place one cake layer down on a cake plate or pedestal. Spread with 1/3 of the frosting, out to the edges. Place the second cake layer on top and frost the cake with the remainder of the frosting. Garnish with rainbow sprinkles, if desired. Store airtight at room temperature or refrigerated.