Make attach_pfunc just a standalone method rather than defining it within FFI.