Preheat the oven to 350°F (176°C). Adjust the oven rack to the middle position.
Butter the bottom and sides of a 10-inch cake pan. Cut a piece of parchment paper so it fits snugly in the pan. Butter the parchment. Shake 1 tablespoon of the flour into the cake pan and tilt it around so it sticks to the buttered parchment. Tap out any excess flour that doesn’t stick to the parchment or to the sides of the pan.
Pour the root beer and molasses into a deep pot and bring the mixture to a boil over high heat. (Make sure there’s some meaningful space between the liquid and the top of the pot. You need those high sides because the baking soda will froth up quite a lot and you don’t want it to spill over.)
Pull the pot off the heat and carefully whisk in the baking soda. Immediately place the pot in the fridge to cool down a little.
While the root beer mixture is cooling, whisk the dark brown sugar, vegetable oil, granulated sugar, ginger, and vanilla extract together in a large bowl. The mixture will seem a little chunky at this point. Crack the egg into the bowl and whisk well until a thick paste forms. (The egg is what makes everything come together smoothly.)
In a smaller bowl, combine the flour with the baking powder, star anise, and cardamom. Grate in the nutmeg and lemon zest, add the salt and pepper, and whisk until everything is thoroughly combined.
Take the root beer mixture out of the fridge. Pour 1/3 of the flour mixture into another large bowl. Pour in 1/3 of the root beer mixture and then 1/3 of the sugar paste. Slowly whisk everything together and then add another 1/3 of the flour, another 1/3 of the root beer, and so forth, until everything is combined. (The mixture doesn’t need to be completely and smoothly combined until the last of the wet and dry mixtures are in the bowl.) You should have a very wet, almost liquid-like batter.
Pour the batter into the cake pan and place the pan on a rimmed baking sheet to catch any drips and splashes. Bake the cake for 45 minutes without opening the oven at all (the cake will sink if you disturb it while it’s baking). Check to see if the cake is high and dark brown with a little bit of spring-back when you touch it (but not too much, as it’s a very moist cake). If it’s not quite ready, rotate the pan and put it back in the oven for another 5 minutes before checking it again. The whole baking process shouldn’t take longer than 55 minutes, even in a slow oven.