hash part of url only available in the browser, as far as I know, server doesn’t have access to # value
Percent encoding is particularly bad since it may also bloat the length causing truncation and the decompress to fail. There's endless footguns with URLs.
If an app is mangling the URL by stripping the query and hash components, then it is breaking URLs and you have a bigger problem than worrying about URLs being logged. Stop using such apps immediately and report the bugs to the app developers.
The idea is nice, but unreliable. The original intent was simply to link a section of a page and it should fail gracefully (and it does when used as intended).