If you set doMobSpawning to false and use the kill command, it will display "Killed X entites" (X means the number of entities) including the player. However, if you explore in unloaded chunks, mobs can spawn even if the gamerule doMobSpawning is false. I did type doMobSpawning "correctly" due to the arguements Java Edition are case sensitive.
How to Reproduce
1. Create Infinite world type
2. Type/click suggested rule name
/gamerule doMobSpawning
3. Type
/kill @e
4. Respawn and explore unloaded chunks.
Linked issues
duplicates 1
Comments 1

Duplicates MC-56687 (works as intended)