I immagine you could use get_player_velocity() in globalstep to find out the current speed and if it's too fast use add_player_velocity() to slow the player down.
Relevant lua api:
https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L5673Though I suspect it would still be somewhat janky it would probably prevent these situations where you are falling several hundres of block per second.