If the job's not worth it to the candidate, they won't complete the task.
Easy.
Remember, it's a two way process; any candidate worth their salt is interviewing the company.
If the candidate is worth it to the company, they won't expect them to jump through absurd hoops, and will treat them with at least a professional minimum of respect.
Which is true? Nobody really knows.
But I don't see how it carries over to companies expecting a huge investment from a developer up front (a week's work, unpaid!), without some major positive differentiator from the other companies requiring decent devs.
That isn't going to appeal to any developer with options.
What's the upside, why would they invest that time - just go to the non-presumptive company next door.