Pre-heat oven to 350 degrees. Line a 9-inch springform pan (heart-shaped if you want!) with parchment paper.
In a medium bowl, whisk together flour, cocoa powder, baking powder, and salt.
In the bowl of a stand mixer or in a large bowl with a hand mixer, cream together butter and both sugars until light and fluffy, 2-3 minutes.
Add eggs and vanilla and mix to combine.
Add the flour mixture to the wet ingredients and mix until just combined.
Fold in coconut and M&Ms to combine.
Press cookie dough into the bottom of the prepared pan as evenly as possible.
Bake at 350 degrees for 22-25 minutes, until edges are starting to crisp, but cookie is still gooey in the middle.
Remove from oven and set on a wire rack to cool. Once cooled, use a knife to loosen edges of cookie and turn out onto a cake plate or platter.
Put buttercream frosting in a pastry bag and pipe along the edges to decorate. Add conversation hearts on top of buttercream if desired.