No, this is not possible. Miners must be allowed to join the network without permission, because otherwise the position of a ‘decision-maker’ becomes necessary. This doesn’t necessarily mean the decision maker is just a single individual (or group of individuals, etc), but in any case it presents an additional barrier of entry to the network.
Consider: if I were a miner, why would I allow my node to ‘give permission’ to any other miner to join the network? By not allowing anyone else to join, I would have less competition when mining. So I would be smart to do anything I could to prevent others from joining.
Further, how does the network come to consensus on which nodes are allowed to mine? This is a non-trivial problem, in fact it is mining itself which allows the network to maintain consensus. You would need to create a whole new system and layer of consensus which would precede the act of mining.
Also worth mentioning: even if it were possible, running a node is inexpensive, so there is no stopping a single entity from just running many nodes in order to run many mining hardware devices.
As you mentioned, there is also no way to force a user to use a specific software implementation. A trusted execution environment is not a solution in this case: forcing something like that would centralize the decision of what runs inside the TEE, which is in stark contrast to the permissionless and open source nature cryptocurrencies. Without these properties, the value proposition of a cryptocurrency like bitcoin is destroyed. What if the decision maker or hardware manufacturer is compromised? Situations like that present huge existential risks to the network.