Well, that seems to have worked. I'll just describe what I did.
Using my K20D, I got into the debug mode by placing a file I downloaded from a link on this forum, on
this thread. It's on the very first post, and the link has 'Dropbox- Pentax Hack Files:' next to it.
The file had the title MODSET.442 (that's the whole title, including the suffix) and the file just has this text: [OPEN_DEBUG_MENU]
(Edited) Other camera models would need a different file.
I copied the file to an otherwise blank SD card, into the root directory I think it's called. To get into the debug menu, the camera is switched on with that SD card in it, with the menu button pressed and the card door open.
first 'VER: 1.04' appeared, (the software version in my case) then after a few seconds the debug menu appeared. I scrolled down to 'LENS ROM SAVE to FILE', pressed OK, and a few seconds later the file was on the SD card. It was named LENSEEP.LNS.
I copied it to the Mac, and when I double clicked on the file to open it, the Mac asked me which application I wanted to use. I chose TextEdit. I altered the file using the 'find' function to go to each example of C0 in column 3 that needed changing to 80, then saved and closed the file, then copied the file back to the card, having first removed the one on the SD card that came out of the camera.
I opened the debug menu as before, this time scrolled to 'LENS ROM LOAD from FILE' and pressed okay. A few seconds later it had loaded. To get out of debug mode, I just turned the camera off and shut the card door.
Mysteriously, a file named BACKUP.LNS has appeared on the SD card, which I think might have got there when I loaded up the altered lens file. It seems to be a copy of the unaltered LENSEEP.LNS file.
I don't know if it made any difference, but my Mac is running the High Sierra OS, version 10.13.6.
Thanks to all for their help and advice.