I think that motorcycle and e-bike safety can be greatly enhanced by never doing things a car couldn't do.
Always stay in the middle of the lane (unless you need to avoid a pothole), never overtake unless a car would have space to overtake, never enter an intersection alongside a car in the same lane.
On a bike, you also have the option of behaving like a pedestrian (cycle on the sidewalk slowly) occasionally.
If you don't do this, it's only a matter of time before a car hits you because it didn't expect a vehicle or pedestrian doing what you are doing.
Also you can see much farther between cars.
I usually ride switching left of the lane to right of the lane occasionally, to create lateral movement so car drivers will notice more (one hopes).
I was coming home from work on my bike very late a few years ago, and I was on the side of the lane where your car tire would be -- not in the center. It was a good thing, too, because there was a full size ladder in the road, lined up exactly in the direction of traffic. Cars could safely drive 'over' it. I missed it by maybe a foot. If I were in middle of the lane, I would have taken a serious spill.
Always stay in the middle of the lane (unless you need to avoid a pothole), never overtake unless a car would have space to overtake, never enter an intersection alongside a car in the same lane.
On a bike, you also have the option of behaving like a pedestrian (cycle on the sidewalk slowly) occasionally.
If you don't do this, it's only a matter of time before a car hits you because it didn't expect a vehicle or pedestrian doing what you are doing.