Even with a massive investment in road improvements, a lot of places in this country will still have narrow roads shared by all users. Terrain, geology and well-established land uses encroach on rights-of-way.
On my commute, Route 28 gets narrow and bendy as it comes into Wolfeboro. The token shoulder disappears. In theory, no motorist can safely pass a cyclist without putting themselves and oncoming traffic at risk.
As I developed my own theories about traffic management a couple of decades ago, I started taking a position further and further into the lane. When the law in New Hampshire made that formally legitimate I experimented with strict herding in that twisty section.
After a couple of seasons I abandoned that method. It made impatient motorists do hideously dangerous things and cranked up the flame under hotheads. Now I ride to the far right through there. It's as close to serene as it will ever be. Granted, I've had some big stuff breeze past my elbow. But when I herded I still had some big stuff go by my elbow, and they weren't breezing.
I would rather have a driver skinny past me, knowing that they don't want to waste time on an accident, than have them seething behind me, wanting more and more to kill me. In nearly every case, I get a bit more room when I let them slide. Because the road is twisty, they aren't screwing around with their phones or other distractions. I figure my odds are about as good as they're going to get.
Further in, where the road straightens and is further constrained by curbs, I move back out into the lane to inhibit stupid passing behavior. The pitch of the road allows me to maintain a speed around 20 mph -- faster when I'm fresher -- so I don't feel like I'm imposing quite so much. Mind you, 20 mph in a car feels wretchedly slow, but soon enough we get to a wide place where I can release the herd to run freely again -- as freely as anything gets to run in Wolfeboro in the summer, anyway. What really happens is that I let them go and then hop in behind them as we all tool along at a very bikeable pace, with them happily in front of the "slower" vehicle.
In a region of narrow, country roads, I ride nearer the right than the center most of the time. I want to be in the forward field of view, even for someone with windshield-induced tunnel vision, with a little wiggle room to the right to ease a squeeze. That one's tricky, though. One squeezer at or near the head of a line can open the space for a convoy to come through in a flying wedge. Even with a rear-view mirror you can't always tell how many vehicles are building up back there. You have to watch the road ahead more than the reflected view. You also have to make some psychological assessments before you open -- or close -- the gate.
The simpler method is to hold that right-of-center, left-of-right position tenaciously. If a driver really pushes the point, use your wiggle room and look for a place to slingshot as many followers around you as you can.
When you get swept aside you may have to slow down a lot. In congested areas with driveways, intersections and parked cars, if you can't stay out in the flow you have to go slowly enough to be ready for ambushes from the side. I hardly encounter urban congestion at all. Where I do, I can keep up with the motor vehicles well enough to stay in the lane. In Wolfe City it's only for a few blocks. In the height of summer's crowds, a bike rider needs to be ready to stop in an instant anyway, because the next bonehead could come from any direction, on two wheels, four wheels, or walking.