They certainly try. Some bikes are better protected than others and part of the certification process is to verify it isn't trivial to hack the bikes. And if this is found to be the case after the fact certification can be withdrawn, retroactively so manufacturers have a lot riding on getting this right.
Note that in plenty of places nobody cares, but in some countries authorities are strict (and getting ever stricter).
If so, Iād guess the requirement is highly unusual. Normally, the requirements you mention would be enforced by certifying the components.
And no, it's not just the components. The reason for that is that the bike motor, controller and rear wheel + sensor all have to be 'just so' for the speed limiter to work properly. There are some defeat tricks, usually stuff that fools the sensor by doing a neat little bit of Bresenham on the input signal but the smarter bike motors realize this is happening and will happily brick themselves. The latest generation Bosch is afaik not yet hacked and this is not for lack of people trying.