In the bowl of a stand mixer fitted with the paddle attachment, cream the butter and both sugars together on medium-low speed until smooth, about 2 minutes. Add eggs and vanilla and mix until incorporated, about 1 minute.
1¼ cups unsalted butter, 1 cup granulated sugar, 1 cup brown sugar, 2 large eggs, 1 tablespoon pure vanilla extract
In a medium bowl, whisk the cocoa, flour, baking soda, espresso powder, and both salts together.
¾ cup unsweetened cocoa powder, 2 cups all-purpose flour, 1¼ teaspoon baking soda, 1½ teaspoons espresso powder, 1 teaspoon kosher salt, ¾ teaspoon coarse sea salt
Add the dry ingredients to the wet ingredients and mix on low speed until no dry flour can be seen.
Cover a clean work surface with plastic wrap. Roll half of the dough (it will be somewhat sticky) into a log about 10-12 inches long and 2 inches in diameter. Use the plastic wrap to help form the log. Repeat with the other half of the dough.
Cover tightly with plastic wrap and refrigerate the cookie dough for at least 2 hours.
When ready to bake, set oven rack to middle position and preheat oven to 350°F. Line 3 baking sheets with parchment paper.
Slice the dough logs into ½-inch thick rounds and place onto prepared baking sheets, 3 inches apart.
Liberally sprinkle each dough circle with nonpareils (if desired), pressing lightly to make sure the sprinkles adhere to the dough.
Colorful nonpareils sprinkles
Bake for 10 minutes, or until cookies are just set around the edges.
Transfer cookies to a wire rack to completely cool.