The other moral here is to stop using memory unsafe languages. It's just so incredibly dumb that we keep making excuses for this.
Has your "memory safe" language been audited for security ?
There is the option of not having data and code sharing the same stack, that seems like a better solution to me but that's such an option is not usually talked about.
Well, RCE (cargo) is built into it. /s