For what it's worth (and with all the usual disclaimers about potentially making your mac unstable by disabling system services), here's some commands that will manipulate this service and services like it. Note the $UID in the command, that's just a bash shell variable that will resolve to some number. That's your numeric UID. You just run these commands from a Terminal command line. No special privileges needed.
If you want to disable it entirely, the first command stops it from respawning, and the second kills the one that is currently running:
launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd
(If you kill it without disabling it will die, but a new one will respawn and pick up where the old one left off)
I don't have this problem myself, so I can't try these next two commands. They're relying on good ole UNIX signals. You could theoretically suspend and resume the process like this ("STOP" and "CONT" are stop and continue):
launchctl kill -STOP gui/$UID/com.apple.photoanalysisd
launchctl kill -CONT gui/$UID/com.apple.photoanalysisd
I don't know what launchd does when running processes are suspended for a long time. Will it detect them as dead and kill and restart them? I dunno. But I do know they won't get any CPU time.
@aselvan quoting myself:
So far, the above has remained true for me, and I haven't had any more incidents with unexpectedly hot device since, so I stopped paying attention to it, therefore I couldn't say how often it's been spawning, since I also disabled cron logging to prevent it from becoming a silent disk space devourer. But I did just stare at Activity Monitor for 3 minutes filtering for it and it didn't even appear (I've spotted it occasionally running at other times though, so it's not gone, just very tame)
If you need to run it aggressively in your case, there are solutions to run cron more frequently, see: https://stackoverflow.com/questions/30295868/how-to-setup-cron-job-to-run-every-10-seconds-in-linux (works all the same for MacOS)
Alternatively, I did also find a potential different solution, northpolesec/santa, which might be able to prevent the process entirely(?) but I have not tested it yet since as I said cron has been working fine for me so I feel it's unnecessary for me personally to bother with now, so I can't directly confirm it works, but it does seem promising so might be worthwhile checking out for you.