It's enforced by exactly zero languages.
It's up to the developer to decide that their function should return an Option/Maybe instead of the naked value.
By definition, any library construct is NOT enforced by the compiler, because... well, it's a library construct and not a language construct.