The application here is that I'm writing a game that randomly chooses node positions the player is supposed to visit. The x- and z-coordinates are chosen without regard for terrain, but I'd like to choose the y-coordinate to be 1 unit above ground level at that point. So if the mapgen happens to make a mountain there, you'd have to climb it, or if the mapgen makes a lake there, you'd have to swim to the lakebed.
The Mapgen class seems to have a getGroundLevelAtPoint method at the C++ level, but it seems inaccessible to mods.
minetest.register_on_generated seems difficult to use for this purpose because the first generated slice of map including the (x, z) coordinates in question may not include the ground-level y-coordinate.