Create a reusable FFI function wrapper
Arguments
- name
Character name of the function
- return_type
FFIType for return value
- ...
FFIType objects for arguments
- library
Character name of library (optional)
- na_check
Logical; if TRUE (default), check for NA values and error if found. Set to FALSE to skip NA checking for better performance (at your own risk).