If you bust a hanger (or bend it badly) it is a challenge to complete a ride. Going single speed (vertical drop-out) is OK for limping to somewhere close but that's it. And even if a bike shop is accessible/near, it's unlikely that they'll have the very one you need. Buy and carry a spare one (they're pretty light and compact).
(Retrospective) advice in the 'Mechanics' Advice for London-Edinburgh-London ride thread in the other place reads:
"If you are running a frame with a replaceable derailleur hanger then you should take a spare with you, thankfully many riders this year did, I replaced 2 bent hangers where the rider had a spare on them. Hangers are normally specific to the frame so very unlikely to be found at a local bike shop. Hangers are designed to be weak so they bend/break off before the frame is damaged."
And a comment was "One rider that we saw at Barney [Barnard Castle control] had fallen on the drive side. The derailleur was clearly out of alignment, but the rider had no spare hanger. We managed to shim the derailleur with a piece of aluminium foil under the derailleur bolt. The result was not perfect, but good enough to put the rider back on the road with working gears."
Note that the BC mechanics (all volunteers btw) chose to fit a shim rather than work-harden the hanger by bending it back into alignment (with implicit likelihood of early failure).
I have a steel frame for my main bike so I have no hanger, but if, in the future, I downgrade to alloy or carbon . . .