To answer some specific questions:
I tried removing and reinstalling the drive. WD's Dashboard utility reports that everything is fine, that "Life Remaining" is 100 %, that the firmware is up to date, that the "Media Wear Out Indicator" is 0.32%, etc. I ran TRIM today and yesterday and the day before that.
As far as I can tell, all drivers are up to date.
Now, a more general observation. I was having problems with Windows hanging or rebooting. I was blaming Windows, since I had no problem in Linux, and I was reinstalling Windows. Then, the problem with the drive appeared, and since the drive was slow also under Linux, I began to think that the problem must be the hardware. I've checked the memory, the CPU, the physical health of the drive itself, and I can find no problem. I'm about to conclude that the motherboard must be defective, but if so, it's defective in a way I haven't seen before.