You need to write some unsafe code in a kernel, but most of the code does not have to be, which allows you to eliminate memory unsafety from almost all code and give more scrutiny to the parts the compiler cannot guarantee for you. I don’t know though if the affected code in openbsd would have needed to be unsafe. Moving towards rust is a possible way for kernels as Linux has shown, but I guess for OpenBSD the pros and cons are different, as it’s striving for a more minimal system and has been affected far less by memory unsafety issues.