Grease a standard 9-inch x 13-inch rectangular baking pan, sprinkle the bottom and sides lightly with granulated sugar, and tap the pan to evenly distribute the sugar around evenly. Set the pan aside.
In a small bowl, place the flour, xanthan gum, cornstarch, baking powder, and salt, and whisk to combine. Set the bowl aside.
In a large bowl with a hand mixer or the bowl of a stand mixer fitted with the paddle attachment, place the butter, sugar, eggs and yolk, and vanilla, and beat until very smooth (about 2 minutes).
Add half of the dry ingredients, and beat until just combined.
Add half of the buttermilk, and beat until just combined.
Add the remaining dry ingredients and then the buttermilk, beating until just combined after each addition. The batter should be smooth and fall off the beater in ribbons.
Pour the mixture into the prepared baking pan, and shake into an even layer. Bang the pan squarely on the bottom on a flat surface to break any trapped air bubbles.
Place the pan in the center of the preheated oven and bake for 22 to 25 minutes, or until the edges are golden brown and the cake springs back when pressed gently in the center.
Remove from the oven and allow to cool for 10 minutes in the pan before transferring, top side up, to a wire rack to cool completely.
While the cake is cooling, make the frosting. In a large bowl with a hand mixer or the bowl of a stand mixer fitted with the paddle attachment, place the butter and vanilla, and beat on medium-high speed until light and fluffy (about 3 minutes).
Scrape down the sides of the bowl, add 2 cups (230 g) of the confectioners’ sugar, and beat slowly until the sugar is absorbed into the butter.
Turn up the speed to high and continue to beat until smooth.
Add the remaining 1/2 cup of confectioners’ sugar, and 2 teaspoons of milk, and beat slowly, then on high speed, until light and fluffy.
Add more milk as necessary, beating until smooth, to achieve the proper fluffy-but-somewhat stiff texture.
Once the cake has cooled completely, return it to the baking pan, spread the frosting in a single, even layer on top of the cooled cake.
Sprinkle evenly with the optional sprinkles.
Slice into 12 evenlys-sized squares in the pan and serve.