Flexible function argument type-checking and defaults