This is where the programmer or even compiler writer should have control, by allowing access to a micro-programmable base that supplies a standard set of instructions. The capability of adding instructions at need being under control of the machine administrator. For most tasks, this additional capability will not be needed, but for those who need to high optimisation, then they can do so with aplomb.
Especially for those who are writing VM's for their respective high-level languages. As with anything, security of the hardware would need to be considered.
One set of minicomputer hardware that I used to program on decades ago (Honeywell DPS6-92's) had a micro-programmable cpu. We didn't use it, as the base level hardware and associated software were sufficient for our needs. But I had heard that various organisations had incorporated their own instructions when needed.
The choice of normal instructions can be quite small, but the ability to put in user defined instructions would allow certain models of thought to be tested and/or developed at a hardware level.