Is it possible to set up the bike computer so that it does this

Just to clarify, I am referring to diy ebikes made with conversion kits.

(I have never owned an e-bike or converted a normal bicycle into an ebike so forgive me if the question is dumb)

Would it be possible to set up the bike computer so that when it gets quickly rebooted it automatically cuts off the motor and pedal assist at 25 kph?

Most of the time the "speed limit" would be higher than 25 kph but I want to be able to lower it quickly in case someone checks whether my e-bike is street legal or not.