I'm fairly sure it's UB though, so ... not sure for what you want this.
the only places i've seen this done where it makes sense would be something like embedded firmware (where a specific fixed memory address that the hardware specifications define would allow direct access to something like a register that can be used to enable/disable/modify the behavior of the microcontroller's features or behavior of certain features). is the UB part in the example you responded to just a matter of pointing to garbage memory so you don't know how anything that attempts to use that pointer could behave? or is there more to the UB in these situations where it would/could even affect the embedded example?