Move the member validation error method to C++.

Raising the error from native code leads to better stack traces.
faster arg parsing when arguments are all objects