My advice for pedestrian-type NPCs would be: don't.
For player characters, we often want to give them full freedom of motion to run and climb and leap or launch themselves around all over the place. That usually involves some form of physics simulation, and checking to see whether they've landed/caught a ledge/gobs of other complex motion states and contact events.
For crowds of pedestrians who mostly stand around and stick to the pathways, this would be excessive. Rather than simulate them physically and check if they're on the ground, we can instead drive them along the ground by construction.
This is commonly accomplished by a navmesh - a polygon mesh representing the walkable/navigable surface of your world. We can use it for more than just AI pathfinding: since the navmesh is constructed to closely follow the terrain, picking a point on the navmesh automatically gets us a grounded position. We don't need to check if the NPC is in the air, because we never build navmesh floating out in the air.
In practical terms this means removing or disabling rigidbody physics from your NPCs, and letting the navmesh navigation component drive their motion.
Now, there might still be edge cases where you need more player-like physics & motion: your NPC gets pushed off of the navmesh, or gets thrown into the air by an explosion, or is standing on a dynamic object like a drawbridge when it starts to open. For these situations you'll want to switch to a dynamic/physics-navigating state for the small collection of NPCs who need this special attention, while still letting the bulk of your NPCs use the cheaper, pure-navmesh route.