When cooking muffins/cup cakes in the microwave, how can I know that the baking powder/leavener is cooked thoroughly? Most recipes are kind of short. Could cooking dough in the microwave result in something containing baking powder/leavener that's too raw?
The most reassuring part first:
Even if you decided to eat a spoonful of "raw" baking powder, the worst that would happen is a fizzy feeling in your mouth, a bloated feeling in your stomach and probably a few really loud burps not fit for polite company when excess gas exits backwards again.
The chemical reaction of baking powder and baking soda starts the moment it gets wet - at least the first stage. That's one of the reasons you don't want to have your batter standing around idly and get it into the oven asap instead.
"Double-action" baking powders get a second round of "activity" once they get warm / hot, ensuring that the cake rises properly in the oven.
Even microwave recipes need at least a few minutes until they are done (baking powder lifting the batter, eggs setting properly...), once your mug cake is hot inside, you can be pretty sure the baking powder has been hot enough to "complete the chemical reaction", assuming that's what you meant by "cooked". And there are at least another few minutes until you actually eat the cake (even if you serve it hot).
If you really want to see how fast the reaction really is, I recommend a few experiments:
I just dumped a teaspoon of baking powder in a bowl of hot water and the fizzing was over in less that five seconds.
Yes, batter will slow that process down a bit, but I think it's way harder (or near impossible with standard recipes) to prepare a a mug cake where the baking powder did not react.