If you're running it while idle and don't need the quickest results, reducing the clock speed improves energy efficiency (and in your case avoids overheating the battery). There will be some optimal speed that maximizes computations per joule that depends on the specific load and can only be found by measurement.
On Linux, you can cap CPU frequencies with "cpupower". Does MacOS have any equivalent?