Spotlight indexing (for Spotlight search: ⌘+Space). In System Preferences > Spotlight > Privacy, you can add folders or disks to prevent Spotlight from indexing them.
I turned it off, it did not help. It still starts on boot and spends minutes indexing who knows what. I never use this Spotlight feature. I guess it looks for forbidden files on my disk, I heard that Apple does that and you need CPU to compute hashes.
FWIW my very expensive 2017 iMac has the same behavior. CPU pegged 24/7 by "mds" and "mdworker_shared". Just opening Activity Manager right now, I see about 20 mdworker_shared processes, each claiming ~11% CPU. I think disabling Spotlight get this under control, but then again, I like and use Spotlight. Surely Apple is capable of writing software that doesn't need to run full blast constantly.
Yea, trust me, it's annoying. I have no idea why it's happening, and web searches and stack overflow have not been particularly helpful. I have resigned myself to just living with a warmer room and having my mac's fans running constantly. This problem has been going on for years, and it's obviously not on Apple's Radar (pun intended).
Lol! If you live near a store, take it in. I’ve had lots of good experiences with Apple stores and soft/hardware issues. The ‘geniuses’ can be a a bit full of themselves, but all in all outcomes are good.