You're describing the fact that OS apis are typed, and check state for validity. That's already the case and OS system calls already incur those costs.
In a database, preparing a query compiles the access plan (ie all the above) on the server side. There's no reason it would be any less efficient than an OS call today.
Could in fact be more efficient, since you would probably be able to leverage set-based operations on the server (ie OS) side rather than iterating everything on the caller.