check_and_cast for non-cObject pointers