A nine-hour layover in Reykjavik turned into a quick loop to the Blue Lagoon and back, thanks to Iceland’s free transit desk that books you a shuttle if your layover is long enough. Istanbul offered something similar, a free guided tour for transit passengers over six hours, which got me into the Blue Mosque and back with time to spare.
Singapore was the best of the three: a free city tour desk right past security, no extra visa hassle, and a stop at the Merlion that cost nothing but the layover I already had booked anyway.
Check your layover length against the airport’s own transit program before assuming you’re stuck at the gate.