Size of OS doesn't matter, Linux is written in C, which has "unsafe, undefined behavior" by default.
The larger a C program is, the probability of "unsafe, undefined behavior" increases.
If there was a type-safe, non-GC C-alternative which had the speed of C, Linux could be rewritten.