There is no security barrier at all in UNIX(-like) Os's between a caller/callee, this is not thing that python can just fix.
There are ways to harden and/or reduce privileges, but shells/scripting languages will always have this issue on any modern OS.
The UNIX way to help prevent that is really to run processes as another user, but people seem to refuse to do so. You should always expect any process running as your UID to be able to access any data owned or visible to your UID.
While it is possible to reduce the risk of disclosure, they are all wack-a-mole preventions protecting the low hanging fruit, not absolute guarantees.
That is purely due to how UNIX works [0]
[0] https://man7.org/linux/man-pages/man7/credentials.7.html