Question: We're currently hiring for a software engineer position and I've been charged with advancing candidates to the in-person interview stage. We've gotten a number of applications from people who have strong development backgrounds but are recent immigrants from India and China and are very clearly English-as-a-Second-Language speakers, ESL.

We're a really small company and our successful candidate would be the lone developer. In addition to programming, they'll also have to occasionally write content as well as make themselves clearly understood to non-tech people.

As such, I'm leaning towards disqualifying anyone whose English comes across as not being totally fluent. Just a note, I'd disqualify native speakers who wrote poorly as well, but for some reason the fact that most of the applications that would be disqualified on these grounds are non-native speakers feels a little wrong to me.

I'd love for someone to weigh in on the legality of disqualifying obviously ESL applicants.

Answer: 
I am not a lawyer, but I'd say you should make sure that it's not the ESL that's the issue but the ability to write well.

There are plenty of people who can't write intelligible English despite being raised in the UK or US. There are also some/many people who don't speak all that fluently, but may still be able to write well. (I, personally, have a noticeable accent when speaking English and occasionally stumble over words. Hearing me speak, you'd probably know that I'm ESL - but my writing rarely garners that reaction.) So don't focus on whether they're "obviously ESL", instead focus on their written language abilities. 

A lot of places will have some form of programming test for developers. You could just as well have a test of asking them to write the type of documentation you want, and have a non-technical user at your company review it. (If you avoid giving the reviewer any information about the applicant, you are further limiting the risk of accusation of discrimination.)
Like other posts you should focus on requiring effective communication in English both written and verbal to perform the job, but be careful you're not going beyond the job requirements. 

If you set requirements too high or aren't really required for this job that can be perceived as discrimination, you could get into trouble. Yes, they need to speak so they can communicate and be understood, but if you indicate that an accent is annoying or "rolling your r's" is unacceptable, that could be trouble. Of course no one says this to the person's face, but someone may notice a trend. 

There were times when practices to keep females out of the work place were applied like requiring applicants to pick up heavy boxes or other test of strength/endurance for a purely office job.