Many thanks to awilkins for this suggestion. Yes I had previously tried just copying a string of zeroes over the raw device using BOOTICE but found I could only write them in sectors 48 upwards. I couldn't write in sectors 0 to 47. I could see sectors 8 to 47 had largely FF in them.
So I've been trying your suggested dd if=/dev/zero of=/dev/sdb and seem to be making some limited progress, but the situation is rather complicated and confused because I now have three failed devices, each exhibiting different failure symptoms. I'm still working on them.
On my 8GB Kingston DT 101 this first step resulted in its disk identifier changing from its previous value to 0x00000000 and it saying it doesn't have a valid partition any more.
As a 2nd step, I tried with "Disk" to format MBR and FAT32. It seemed to go through the motions and changed its disk identifier from 0x00000000 to a new value, but at the end said it didn't have a valid partition table
As a 3rd step I tried mkdosfs -F 32 -I /dev/sdb which worked because when I removed and replugged the device in, it was recognised, showing 358MB used and 7.6GB free. I was able to save three small text files, safely remove the drive, reinsert it, and find the three small text files still there. This looked good, but unfortunately it didn't last.
When I tried to safely remove the drive again, I couldn't because it went into continuous flashing mode and never stopped. When I pulled it out and reinserted it again, it was back to telling me it didn't have a valid partition again. A couple more tries with mkdosfs -F 32 -I /dev/sdxx got it working again but now it was showing 817.6MB used and 7.2MB free. Something had been eating up its free space.
At this point I took it over to Windows and tried it there. Windows said it had 6.67GB free out of 7.44GB, and when I tried to open it, I found an unrecognisable folder with an impossible creation date and a couple of large unrecognisable files that couldn't be deleted. Maybe the FAT formatting I'd done on Linux was being misinterpreted by Windows so I thought I'd try a Windows format. Windows formatting failed and said the device was write protected.
Next step was to have a look using TestDisk. TestDisk told me no partition was bootable. Further examination though, revealed a couple of Linux partitions thus:
Start End Size in sectors
1 * Linux 157 14 50 351 151 56 3125248
Linux 157 177 21 352 59 27 3125248
I can only assume that these Linux partitions were the original bootable ones I burned on to the drive from Linux .iso downloads a couple of years ago and which I've never succeeded in removing by reformatting.
Experimentally I tried to rewrite the first of these as a Primary partition, but TestDisk came back with a "Write error", indicating that it's still seeing the device as write protected.
I remain confused why Windows and TestDisk are still seeing this drive as write-protected when I've been able to save small text files on it from Linux. I think it must be something to do with boot sector incompatibilities, and I'd like to know how to write a completely new boot sector on this device which will be recognised by both Linux and Windows and which will clear the write protection I'm still seeing when I use Windows. Earlier this year I checked regedit HKEY_LOCAL_MACHINE\System\CurrentControlSet/control\StorageDevicePolicies and verified writeprotect was set to 0.
Thanks for bearing with this long story, which is only about one of my three failed devices. Maybe I'll work on the other two and post again later.