Redact and truncate a request/response body for safe single-line display.
JSON bodies have sensitive keys recursively replaced; newlines/tabs are
collapsed to spaces so snippets stay on one line. max bounds the char count.
Rebuild a URL with opaque path segments and sensitive/opaque query values
redacted. unsafe_include returns the raw URL. Falls back to redact_value
on parse failure.