Mix the flour, ginger, cinnamon, salt, and baking soda in a large bowl until well combined.
Whisk molasses and hot water together.
Cream the margarine and sugar. Whip the mixture with the optional egg until light and fluffy.
Add part of the molasses mixture and part of the margarine and sugar mixture to the dry ingredients. Begin to combine. As the ingredients come together, add more of the margarine mixture and more of the molasses mixture until everything has been incorporated. Whisk to remove lumps, but do not over-mix.
Pour the batter evenly into cupcake molds (you should get an even dozen, just fill them almost to the top).
Bake at 350F for 20-25 minutes until a cake tester comes out clean, or the top of the cake, when touched, springs back. Let cupcakes cool completely before frosting.
Prepare frosting by beating all of the frosting ingredients in a stand mixer until well combined and fluffy. Frost cupcakes and enjoy!