The best way for a confident, fit rider who isn't burdened with a heavy load up a hill, carrying or accompanying children, or otherwise preferring a sedate approach today and in this place, to avoid this sort of confrontation is to ride on the carriageway, rather than the pavement. However the best way to avoid potential numpties in cars struggling to deal with the same sort of confrontation in the carriageway with the added fun of three tonnes of metal heading towards each other at a closing speed of up to 80mph is to ride on the shared path and to deal with passing slower path users with the very same care and caution as you would want from people in cars when you're on the carriageway.
FTFY