What is the threat model for this? If you are able to ptrace a process you can
do all other kind of stuff, like replacing gpg with your own code. If the box
has been taken over, we are in game-over state.
Disabling core dumps is a different issue because a core dump leaves traces of
the process on the disk.