Not sure if this is possible, even the limitation of cpu clock. to prevent heat the cpu change mostly cores with some tasks.
In some applications a user can only select number of cores he want use. Like boinc or the stockfish chess engine.
(apples chess engine lost against stockfish, no sign of machine learning)
I don't think apple has some api that allow to manipulate the core and clock management. But i haven't read apple´s xcode documentation and are not a programmer.
On some intel machines people used turbo boost switcher to turn off/on turbo mode. This was the only thing i can remember.