In a large bowl, whisk together the flour, baking soda, ground ginger, cinnamon, cloves, nutmeg, black pepper, and salt. Set aside.
In the bowl of a stand mixer fitted with the paddle attachment (or using a hand mixer), beat the butter and dark brown sugar together on medium-high speed for 2-3 minutes until light and fluffy. Scrape down the sides of the bowl.
Add the molasses, egg, and vanilla extract to the butter mixture. Beat on medium speed until fully combined, about 1 minute. The mixture may look slightly curdled — that is normal.
With the mixer on low speed, gradually add the flour mixture and mix just until a soft, cohesive dough comes together. Do not overmix.
Chill the Dough
Divide the dough into two equal discs. Wrap each tightly in plastic wrap and refrigerate for at least 2 hours, or overnight for best flavor and ease of rolling.
Roll and Cut
When ready to bake, preheat your oven to 350°F (175°C). Line two large baking sheets with parchment paper.
Lightly flour a clean work surface. Working with one disc of dough at a time (keep the other refrigerated), roll the dough out to exactly ¼-inch thickness.
Cut out shapes with your desired cookie cutters, dipping the cutters in flour between each cut for clean edges. Transfer cut-out cookies to the prepared baking sheets, spacing them about 1½ inches apart.
Gather the dough scraps, re-roll, and cut out more cookies. Refrigerate the cut cookies on the baking sheet for 10 minutes before baking if the dough has softened significantly.
Bake
Bake one sheet at a time in the center rack of the oven for 8-10 minutes, until the edges are just set and the centers look barely matte — they will look slightly underdone, and that is exactly right.
Remove from the oven and let the cookies cool on the baking sheet for 5 minutes before transferring to a wire rack to cool completely. They will firm up as they cool.
Decorate
Once cookies are completely cool, prepare the royal icing: beat powdered sugar, meringue powder, and 3 tablespoons of water together until stiff peaks form. Add water a little at a time to reach your desired consistency — stiffer for outlining, looser for flooding.
Tint icing with gel food coloring as desired. Transfer to piping bags or zip-lock bags with a tiny corner snipped off. Decorate cookies as desired and let icing set completely, about 1-2 hours, before stacking or storing.
Notes
Make-ahead tip: Dough can be refrigerated for up to 3 days or frozen for up to 3 months. Baked undecorated cookies keep at room temperature in an airtight container for up to 1 week. Decorated cookies keep for up to 5 days layered between parchment paper. For crispier cookies, roll dough slightly thinner (⅛ inch) and bake 1-2 minutes longer.