I do stream live coding on twitch from time to time -- albeit I started out as a speedrun streamer. You have a point: if I were to write code in the same style I'm used to, it would probably be not that good. But, probably due to the very fact that I know I'm being watched, I noticed I employ a different style than usual: very neat, organized, logical, working on exactly one feature at a time and not allowing myself to wander too much. It definitely feels good and productive.