Is commuting 10 km on an empty stomach harmful?
As far as I can tell, no. I've been riding 30 minutes or more every workday before breakfast for more than 10 years with no detectable ill effects. When I was riding an hour to work I'd sometimes have a small snack before riding, but only rarely. When I'm cycle touring I'll often ride for an hour before I have breakfast, as that wakes me up and gets me warm, then I can stop and eat somewhere pleasant (I usually stealth camp so I'm not always sleeping in a nice place to hang round during the day). But an hour isn't an unreasonable ride before breakfast. For me!

What matters is being aware of your body. If you're feeling bad, stop and work out why. If you're hungover... what did you expect? But if you normally feel fine and one day your stomach hurts, or you feel weak, or something else changes, worry. Stop, work out what the problem is. Eat, drink, pee, whatever. It's the same as if your bike feels funny or starts making a weird noise.

Normally I carry breakfast to work, so I have it with me if I need to stop and eat. I also have money, which is surprisingly useful for solving problems :) If I need to I can get a taxi to work, buy food, whatever.

FWIW I was vegetarian for most of that time, of late I've gone back to eating meat every couple of weeks (I'm getting older and meat seems to help me maintain muscle mass). I don't know if being vegetarian helps, but it doesn't seem to hinder the ride before breakfast.

(ok, I've been doing this for more than 15 years, possibly more than 20)