The brake light on my Tesla will come one by slowing down, regardless of reason.
On my Bolt EV, I made sure that was the case when I started using the "single-pedal driving mode". Unfortunately, the brake light turns off once the car comes to a stop. That's unfortunate, because to be safe, the pedal must be still depressed after all.
Nobody wants to be rear-ended in a car, let alone on a motorcycle. On electric motorcycles, the computer should illuminate the brake light if measurements from the wheel speed sensor indicate the bike is slowing at or above a certain rate. The computer might drive a relay in parallel with the two mechanical brake switches.
I've been using 100% coasting regen on the FX, so I have to consider consciously the brake light status and control it manually. Personally, I always monitor for vehicles behind when slowing, and slow prematurely until it's abundantly clear the car behind me is slowing too. The time I forget to do that, or can't because I'm already stopped, I'm at high risk of getting smashed.