In the bowl of a stand mixer fitted with a paddle attachment or in a bowl with a hand mixer, beat the butter and sugars on high until pale and creamy, about 4 minutes.
Add the eggs one at a time, mixing after each. Add the vanilla extract and mix until combined.
In a separate bowl, sift together the cocoa powder, flour, espresso powder (if using) and salt. Add to the mixer bowl in 2 additions and mix on low until just combined.
Divide dough in half and place on a sheet of plastic wrap. Use the plastic wrap to help shape the dough into a disk (dough will be sticky). Cover completely with the plastic wrap. Chill dough for 1 hour and up to a few days.
When ready to bake, preheat oven to 350°F and line 2 sheet pans with parchment paper.
Working with one disk of dough at a time, roll out on a lightly floured surface to about 1/4 inch thick. Cut shapes as desired. Place on the prepared sheet pans 1/2 inch apart. Chill in the freezer for 15 minutes.
Bake cookies just until the edges are firm, 10-12 minutes depending on the size of your cookies. Do not over bake. Since the cookies are dark in color it may be difficult to see when they are done, so you may wish to bake a few test cookies to be sure you get the timing right.
Let the cookies cool completely before frosting.
Store cookies in an airtight container at room temperature for several days. Unfrosted cookies may be frozen for up to one month, stacked between layers of wax paper.
To make the frosting:
In the bowl of a stand mixer fitted with a paddle attachment or in a bowl with a hand mixer, beat the powdered sugar, butter, whipping cream, vanilla and almond extracts on low speed a few minutes until the mixture comes together in a thick frosting.
Increase speed to high and whip for several minutes until light and airy, scraping the bowl down periodically. Add food coloring and mix until smooth, if desired.
Frost cooled cookies as desired. Frosting can be made up to 2 days in advance. Store in an airtight container at room temperature.