Using isdefined to check where a function is defined

Right. That works, except if you define it in an included file. See also this related question Trying not to overload Base.open - #4 by Sukera, where @Sukera demonstrated how you can trigger this by “just defining it”.
This is the case here: CxxWrap builds the list of names that are defined on the C++ side and imports them into the current module. That’s what triggers this error.
The code for importing the list of names is here: https://github.com/JuliaInterop/CxxWrap.jl/blob/master/src/CxxWrap.jl#L451-L457
The isdefined guard was put in place to fix a bug:
set_override_module within add_type<Parametric...>().apply<...> · Issue #199 · JuliaInterop/CxxWrap.jl · GitHub
The question is if there’s a way to import the names from the C++ module without triggering the error.
See also the discussion here: Change in name resolution leads to clash with Base.open · Issue #226 · JuliaInterop/CxxWrap.jl · GitHub