Make the PoW require so much memory that a significant fraction of machines will start swapping,
If you prevent botnets from mining (e.g. by requiring an unusually large amount of memory) you prevent ordinary users from mining and encourage centralized farms.
I said "significant fraction", not large majority. A memory requirement between 1/2 and 2GB will
make ordinary users with little memory suffer, and allow ordinary users with plenty memory to mine.
Both groups constitute a significant fraction.
Okay, but then botnets will just stick with machines having sufficient (free) RAM. They'll use their other (smaller RAM) bot machines for something else (possibly mining a different coins).
I'm aware that botted machine are disproportionately older and less powerful but not entirely. There really has to be a pretty large overlap between users and bots, otherwise bots will just disappear entirely as the older machines gradually and eventually go out of service.