Actually... What I said about my solution isn't right.
The problem being intermittent makes this hard to locate
I have now pretty certainly I know what it is.
I have an M.2 SSD in an Orico enclosure. When that is attached, it can occasionally cause slowness when I log in.
Theoretically the disks are mounted by then.. so its not a mount. (In fact I know the disks are mounted because if I leave terminal open and login... I can make unix commands and mount does show the external disk as mounted).
This manifests itself as the desktop taking ages to appear, and seems to have stalled. The disks do NOT appear on the desktop (mostly), and even when they do you cannot double click them (any of them, including the OS internal disk).
Apps open (if previously open), but then they have spinning icons (most of the time)... occasionally they appear functional as long as you don't tdo anything too fruity. Unix Terminal behaves as long as you don't try to navigate to the offending Volume).
The disks appear ok as far as Disk Utility is concerned.
Spotlight appears to be stuck indexing (its not a spotlight problem though.. because even if I disable spotlight this still happens - again intermittently).
BUT if I just pull out the thunderbolt cable connecting the enclosure... boom the desktop appears and the Mac runs normally. I can then replug in the USB enclosure, and its all fine (bar the message about not having correctly ejected the disk).
So, it's something to do with access to the disk connected on the thunderbolt port. The disk access light is blinking very rapidly when its doing this.. suggesting access.. but whatever its doing its doing it really slowly and it's blocking everything else.
I am getting another (different company) enclosure today... and I'll be able to narrow it down if this one works.
However if the new one behaves the same, then it suggest the OS is performing some kind of blocking activity that prevents any other IO until that has completed whatever its doing.