It also appears that the EU law has not addressed the problem as the new Bosch crank drive units have an accessible connector to modify the units output and people are already exploiting this.
The power control unit should be encapsulated so it cannot be modified - this is the only thing that needs to be approved and then the allowance of a full throttle in the UK would not be an issue.
As soon as you modify a vehicle to put it into another category, for example by deregulating the speed restriction on a moped to turn it into a light motorcycle, or by fitting an 80cc barrel and piston kit, then you have to ensure that it meets the requirements of the new category in order to remain legal.
In the case of an ebike that can be de-restricted, then by doing this it would become a motor vehicle, in all probability a moped, and would then have to be compliant with the relevant regulations for a moped to be legal.
There are plenty of precedents in law for dealing with this situation, perhaps the most common being the stipulation by insurers that all modifications must be notified to them. In the case of a legal ebike, where the owner may have insurance for it as a bicycle (or bicycle cover under a household policy) then by modifying it to turn it into a motor vehicle that insurance may no longer be valid.
Legislation and regulation can't really tackle the deliberate modification of vehicles, other than by defining legal categories in such a way that it's clear when something falls outside a particular category and into another.