Stochastic star formation and a (nearly) uniform stellar initial mass function