So I thought "external speakers will fix it" and marked a couple on eBay, intending to bid tomorrow if the price wasn't ridiculously high.
Then went to a car boot fair today and found a pair on one of the stalls for £2
Then took them home and tried them, with zero result.
So I finally tried plugging in some headphones and got badly distorted sound on one ear, nothing on the other. I'm guessing this means the sound part of the motherboard is borked in some way. I've tried various resets etc., looked at the speaker socket and can't see anything, etc. etc.
So barring a sudden flash of inspiration this means I'll be selling this one cheap too. Disappointing, but it cost me about £25 including the iMac itself, memory, and a Wifi card, I should get at least £60, so the main loss is time and patience.