Python strings are immutable at the Python level: the underlying memory is only modified incidentally by the implementation, as an “as-if” optimization.
If you need this level of control over memory, you will need to use some kind of mutable buffer type, ensure that the buffer is never reallocated (which would cause the implementation to move the data and leave the original underlying allocation alone), and presumably implement your own interface over top of that to interpret the data. bytearray is the most obvious choice for this. Then you would need to arrange a way to make sure the buffer is consistently zeroed out before being garbage-collected.
Of course, if your program is still using the “string” at the time that the memory dump is created, there is nothing that could be done about it in Python, or any other programming language. It is the same as how DRM can never be fool-proof. If you have access to the data, you have access to the data.
It is worse the you know as the sensitive data may get written to the windows swap file as well.
There ate API to allocate memory that is never written to swap/page files. But these are only usable at the C level. It is also a skilled job not to leak the sensitive data outside of the special memory.
You might be able to write a C extension to do this so long as the sensitive data is never given to python, as it will then be leaked.