Lightweight validator for function arguments