Mappings don't have length by design. They also don't have a concept of a key or value being set.
When mappings are initialized every possible key exists in the mappings and are mapped to values whose byte-representations are all zeros.
In details it goes like this:
When userLevel is initialized it’s done in such a way that every possible Ethereum address exists in the mapping and is mapped to a corresponding level of 0.
It doesn't matter whether it’s a random Ethereum user’s MetaMask address who perhaps has never even heard of the game before, or maybe an arbitrary smart contract on the Ethereum blockchain doing something totally unrelated. Our mapping still maps them to a value whose byte-representation are all zeros.