Maybe this issue could lead to a new feature on Stack Overflow. Godbolt could end up providing its own URL shortening feature, but this would not fix similar troubles for other popular developer tools sitesother popular developer tools sites which would not have such a feature themselves, while requiring longs URIs.
Stack Overflow could provide a feature named something like "external site URL shortener", which would generate and handle shortened URIs for external sites, but limited to a well-known external sites list.
This list could be expanded from the user's requests, with some voting system on those requests. Popular ones would trigger a moderator review for them to decide whether to accept the external site or not.