the random foreigner who replies to a couple of job listings, has industry experience, and can crank out more than php or javascript spaghetti (because there are plenty of good developers here who will work for much less than sv wages) can definitely find startup-like situations. or maybe i just lucked out, dunno.
The low end tech scene is quite vibrant but wages for competent dev's keeps going up. China really just isn't that poor anymore; though you still have plenty of kids who are poorly trained but willingly to work hard on the cheap.
Most foreigners outside of the few American tech companies are entrepreneurs and/or managers. I'm quite unusual as a researcher.
and plenty of kids who -- with or without formal training -- are solid hackers.
there are def more foreign businessmen than 老外 devs, and not without some cause: i'd definitely get more compensation from a startup in the bay or bank in ny than i do at my current job.
Not in this case: they specifically target foreigners working without permits here, though mostly English teachers.
China isn't really a cheap place for bootstrapping a startup, so the random foreigner coding in starbucks isn't going to attract any attention. Kai Fu's Innovation Works, a YC-style incubator, can help get foreigners working visas for incubated projects, I think.