Just in case this saves anyone else a few minutes of boring googling: the solution was to log out of the iTunes store and log back in again.
Details:
iTunes on Mountain Lion was being very unresponsive and beachballing, despite not apparently doing anything except playing music, and Activity Monitor said it was using 100% of one of the CPUs.
The CPU activity would drop right down when I stopped the music and jump up again when I restarted it. After searching around on the Apple support forums, I saw the suggestion to log out of my iTunes Store account; it seemed unlikely to work, since I didn’t have the store open… but it did. And I was able to log in again without the problem returning (yet! *crosses fingers*). Hope this helps someone.