Preheat oven to 350°F (175°C) and line a 12-cup muffin tin with cupcake liners.
In a medium bowl, whisk together flour, cocoa powder, baking soda, baking powder, and salt.
In a large bowl, beat sugar and oil until well combined. Add eggs, one at a time, beating well after each addition. Mix in vanilla and peppermint extracts.
Alternately add dry ingredients and buttermilk to sugar mixture, beginning and ending with dry ingredients, mixing just until combined.
Divide batter among cupcake liners, filling each about 2/3 full.
Bake 15-18 minutes, or until a toothpick inserted in the center of a cupcake comes out clean. Cool completely on a wire rack before frosting.
For the frosting, beat softened butter in a medium bowl until creamy. Gradually add powdered sugar, beating until smooth. Mix in vanilla and peppermint extracts.
Add milk, one tablespoon at a time, until desired consistency is reached. Add food coloring if using.
Pipe or spread frosting onto cooled cupcakes. Garnish with chocolate shavings or mint leaves if desired.
Notes
These mint chocolate cupcakes are perfect when you want a refreshing twist to your dessert. Experiment with the frosting color to match any themed event!