Preheat oven to 350°F. Line two baking sheets with parchment.
Melt the 3/4 cup butter for the dough. Whisk in 1/2 cup cocoa until smooth and glossy; cool 5 minutes.
Beat sugar, eggs, and 2 tsp vanilla in a large bowl until slightly thickened.
Stir in the cooled cocoa‑butter mixture until combined.
Whisk flour, baking soda, and 1/2 tsp salt. Add to the bowl in two parts, alternating with buttermilk. Mix just until no dry spots remain.
Scoop 1½-tablespoon mounds onto sheets, spacing about 2 inches apart.
Bake 8–10 minutes, until the tops look set but still soft. Cool on the pan 5 minutes.
Make icing: In a saucepan, simmer 1/2 cup butter, milk, and 1/4 cup cocoa, whisking until smooth.
Remove from heat. Whisk in powdered sugar, 1 tsp vanilla, and a pinch of salt until shiny. Fold in pecans, if using.
Spoon warm icing over warm cookies. Let set until the icing firms, about 20 minutes.