Run the Apple Diagnostics to see if any hardware issues are detected. The diagnostics generally do a good job of identifying cooling system issues, plus it is generally good to identify power related issues. However, if you installed a third party battery, the diagnostics may fail the battery test even if the battery is good & healthy since some third party batteries do not communicate as expected.
Power related & sensor issues will cause the CPU to run at idle speeds of 800Mhz. This includes the battery not being connected, or the Trackpad is disconnected, etc.
Unfortunately I have encountered some Apple laptops where the system performance is so slow that I thought the CPU was being throttled, but where I have seen no indications of any thermal or power related issues and macOS command line utilities were reporting the CPU running at Ghz speeds. In those cases, there was some unknown issue with the Logic Board. In some of those cases I suspect there was accidental liquid damage to the Logic Board, but not necessarily all of them. I don't recall the Apple Diagnostics reporting any issues in those cases either, but the issue did follow the Logic Boards.
For an Intel Mac, IIRC the following command will show the CPU frequency:
sudo powermetrics | grep -i 'average frequency'
I usually used 'system average' instead for a simple single line instead:
sudo powermetrics | grep -i 'system average'
If the CPU frequency is showing Ghz values and the Apple Diagnostics pass and you are having severe performance issues from a clean install of macOS (no restore from backup, no third party apps installed, not signed into AppleID/iCloud, no external devices connected), then most likely the Logic Board has failed.
I don't recall how or even if it is possible to read the CPU temperature using the macOS built-in command line utilities since I usually use Macs Fan Control for that purpose since it gives access to many other temperature sensors.
Otherwise if the system is being thermal throttled, then it will usually be caused by third party software.