Preheat the oven to 350°F. Line a 9x13-inch metal pan with parchment paper, leaving overhang on the two long sides.
Whisk the melted butter with the brown sugar and granulated sugar until smooth and glossy.
Whisk in the egg, egg yolk, and vanilla until the mixture lightens slightly in color.
Add the flour, baking soda, salt, and cornstarch if using. Stir just until the flour disappears into the dough.
Fold in the M&Ms and chocolate chips by hand until evenly distributed. Save a handful of M&Ms for the top.
Press the dough evenly into the lined pan and scatter the reserved M&Ms over the top. Bake for 22-26 minutes, until the edges are golden and just pulling away from the sides but the center still looks slightly underdone.
Let the pan cool for about 20 minutes, then use the parchment overhang to lift the slab onto a wire rack. Let it cool completely, at least 45 more minutes, before cutting into bars.