openSSL and key encryption password

I was looking for something in pyOpenSSL here: https://github.com/pyca/pyopenssl/blob/1257600e1603ed57455d92758eb1da857cd61725/src/OpenSSL/SSL.py, when I found out OpenSSL saves user cert in immutable _passphrase_userdata variable. Isn’t it kind of dangerous to store such a credential like that?

Since I’d like to repeatedly decrypt private key, set_passwd_cb callback is handful, but I don’t know if I am ok with saving credential to memory forever.