Assuming the platform doesn't expose another means of peeking at memory locations (I know C++ is usually compiled to actual machine code), is it possible, the way it is in e.g. JavaScript?
I know there are utilities such as memcpy and bit_cast. They work, IIUC, on any data that the language syntax or the standard library can produce. But would it be compliant with the C++ standard for an implementation to provide custom types, or perhaps a facility working with normal types (like an exotic Allocator), to whose members some values can be assigned and yet nothing the programmer could write (or #include, even coming from an untrusted source) would be able to read them in an uncontrolled manner?
Yes, that would be legal. Undefined Behavior may include behaving in a way that's typical or documented for a given environment. Hence, your proposed C++ extension should be designed in such a way that using them is UB according to the Standard, but still documented by the implementation.