Randomized pids wouldn’t nexessarily help that much in this situation, especially if the getuid syscall is available. However, I agree with your general sentiment that there are basic security features that Linux could implement to make a lot of CVEs impotent. I think the community is coming round, but this stuff takes more work than most people may realize.