What is the safest and most courteous way to ride on a two-lane road?
I use the method in your 3rd picture - I take the middle of the lane when there are no bike lanes. I am helped in these cases by the fact that these roads in my city usually specify the right-most lane as a shared car and bike lane.

Besides the speed issue you state when riding on the sidewalk, it is also hazardous for both the cyclist and pedestrians.

I feel that riding far to the right, while still in the lane, just invites cars to pass you even when there isn't enough room. 

Taking the middle of the lane is my way of encouraging them to overtake the proper way by fully moving into the left lane.