The practical solution is to reallocate usage of the street to prioritize all modes of transport. i.e. Take a car lane and replace it with proper 2-way concrete barriered bike lane.
They're on the sidewalks because they don't feel safe riding in the street, and who would with huge trucks blowing past you at high rates of speed. But if you give them some infrastructure and someplace safe to ride, they won't be forced to dive through pedestrians on the sidewalk.
The road the sidewalk paralleled is great (for the area) cycling infrastructure. 25 MPH, low traffic, sharrows, signed Bicycle Route, and with wide paved shoulders.
What I mentioned above was more likely out of ignorance than fear.
The issue is Stroads [1][2]. Infrastructure caters too much for cars. If we had real streets, this wouldn't be an issue.
I was just in Nashville, and they have scooters you can use. It felt 10x more dangerous than me biking at high speed in NYC. Even though there was a bike path, it was next to cars going 50mph, not fun, nor safe.
[1] https://www.strongtowns.org/journal/2013/3/4/the-stroad.html
If you look back at when cars or bikes were first introduced you’ll see the same complaints about dangerous behaviors and being incompatible with horses. For cars, it’s not wrong because at the time traffic laws were incomplete, there were no street signals, and people didn’t even stay wide when making left turns.
It's neither. The actual reason is lack of biking infrastructure.
Putting a "Share the Road" sign and/or painting some bicycle symbols on a narrow path right next to cars going 50 mph does not constitute infrastructure, nor does it make the road any safer for cyclists.
And even if there was better cycling infrastructure, we'd still need a way to keep people from riding bikes on the sidewalks. Without enforcement, no amount of infrastructure will stop that.
And that's never going to happen either. What are you going to do, have a police officer for every bike path next to a sidewalk?
While I never rode on sidewalks when using a standard bike, I'm much more confident in traffic on an e-bike. It's just much easier to deal with stop-and-go traffic on an e-bike.
On a regular bike, I was never entirely comfortable riding on the road. You're either riding in traffic and holding up a lane of cars, or you're too close to parked cars and risk being doored.
With e-bikes, I can easily keep up with traffic in the city, even in stop-and-go traffic conditions, or at traffic lights. On an e-bike, I have no problem at all pretending I'm a car, and obeying traffic laws exactly as I would in a car.
Law enforcement can say "You can't ride that here!" but if a reasonable alternative path doesn't exist that doesn't really solve anything.
A two-way bike road for various types of bikes is way cheaper than a road expansion to carry the same number of people via cars, but we still view that as an "extra expense" while we don't hesitate to rip up a road to expand it from 2 to 4 or 6 lanes for cars.
Plenty of cities have built cycling infrastructure. That's the solution, not law enforcement.
To note, the sidewalk I mentioned above while writing the earlier comment parallels a local cycling route. It's a 25 MPH residential street that also has wide paved shoulders, with sharrows, signed as a formal bicycle route. I ride it almost daily, and it's a great route to ride. There's no reason to ride a bicycle on the barely-two-person-wide sidewalk there except out of ignorance.
On one hand, I know having more people riding is broadly a good thing because it increases demand for infrastructure, makes drivers more aware that they should be looking out for non-car stuff, etc... but on the other hand, I can't help but be a bit grumpy as a long-time muscle powered bike commuter that these new electric ones with throttles make it really easy for casual riders to throw all of the normal convention and expectations about how bikes move and behave out the window, often to the annoyance or risk of people around them.
A decade ago there was never any expectation of being passed at a high rate of speed while climbing a bridge or hill, nor many riders who were capable of racing up to a tight gap or turn only to slam on brakes and floor it out of there, burning momentum in the process. Stuff with throttles mixed with stuff without throttles mashes together two very different ways of riding.
In the park I mention above, the street next to it is 25 MPH, has sharrows, and also has a very wide pretty much unused paved shoulder as well. Except for ignorance, there's no reason for eBike riders to be using the only-about-two-person-wide sidewalk.
In the past the speed came with skill which developed through experience. Now that speed is often at the press of a throttle (or setting the assist to high) there are more folks at high speeds without the developed skill or etiquette.
Heck, at one of the local parks that I work with (volunteer cycling advocate who develops trail systems), they are trying to figure out what to do about eBikes on their paved walking/running/biking loop which parallels the park road. In the past the mixed use was fine, as most riders on the loop were going slow; families/kids/whatever and coexisted just fine with walkers. The faster riders would be out on the road, going roughly the same speed as the cars.
Now that eBikes are becoming popular, the less-experienced folks are sticking to the path, but at higher speeds, causing issues with the walkers. Walkers being clipped by bikes is not unheardof on these paths in the past, but it's becoming much more frequent now that the walker-rider speed delta has increased.
(For reference, ~8-12 MPH was common for human-powered riders on these paths. eBikes roughly double the average speed.)
Around here (southeast Michigan, US) it's very common to see folks on eBikes riding on sidewalks or non-motorized trails at speeds that far exceed those on human-power bikes. The speeds afforded by eBikes, even pedal assist ones, makes them a whole different thing from traditional human powered bicycles. Some/many are effectively just electric motorbikes (throttle control and all) that fly under the radar because they happen to also have pedals and no traditional "motor" noise.
I feel like I'm somewhat grumping about something that I realize there's no practical solution for, but it's quite difficult when I'm walking on a sidewalk and someone comes flying by at 20 MPH (capped speed for most eBikes). Folks on human power bikes rarely reach these speeds, and those that do are usually more experienced riders who'll be doing so in the road, not on a sidewalk or hiking path.
Heck, while I was typing this comment I saw someone ride the path through the suburban park across the street from house on a throttle-control eBike, helmetless, going full speed, swerving between walkers. That's a recipe for disaster.
I recognize this is an law enforcement issue more than anything, but at the same time it's pretty unlikely that policymakers and enforcers are going to do anything about it because they've got other priorities. Whether due to ignorance or lack of concern, it seems we can't depend on folks to do the right thing, and thus it's frustrating all around.