The impression I got, and it's only an impression based on various blog posts, articles and mailing lists over the years, is that OpenBSD is the most secure operating system even though it's mostly programmed in C (and that they're not looking to replace that with Rust, et al) with mitigations like W^X and pledge, etc; and the fact that their code base is the smallest. I mean I know this is a wide and complicated area with different classes of bugs and vulnerabilities, but still I thought it was generally accepted.