I would probably make an exception if they offered to pay me even a token per hour (or even donate the hourly to a charity - it's about incentives not money). I have made an exception when it was literally a 20 min code challenge for a promising lead.
On one hand, this does frequently stop things moving forward. On the other hand I never felt like I missed out.
One company I sent them my usual polite decline and got back an angry rant from the CEO! I responded with "Well, give me your product for free for 8 hours or so and I'll give you my time for free for the same length." He did not respond after that.
This is probably bad advice for very new engineers where a code sample can help differentiate you a lot, but I wish more senior+ engineers would refuse these dumb tests.