Prep: Preheat oven to 350°F. Grease a 9x13-inch baking pan.
Mix dry ingredients: In a large bowl, whisk together flour, sugar, salt, and baking soda.
Make cola-cocoa mixture: In a medium saucepan over medium heat, combine butter, Coca-Cola, and cocoa powder. Stir until butter melts, then bring to a gentle boil. Remove from heat and stir in mini marshmallows until mostly melted.
Combine: Pour the hot cola mixture over the dry ingredients and whisk until smooth. Add buttermilk, eggs, and vanilla; whisk just until combined. Batter will be thin.
Bake: Pour batter into the prepared pan. Bake 28–32 minutes, until a toothpick inserted in the center comes out with a few moist crumbs.
Make frosting: About 5 minutes before the cake is done, melt butter with cocoa powder and Coca-Cola in a saucepan. Bring to a boil, remove from heat, and whisk in sifted powdered sugar, vanilla, and salt until glossy. Stir in pecans if using.
Frost while hot: Pour warm frosting over the cake straight from the oven. Tilt the pan to spread evenly. Cool at least 30 minutes before slicing.