Sergey, perhaps you can explain a bit more? I looked through the file including the usage stuff. As best I can tell, you mean that I could run both the C (found in Modules/_decimal/) and the python (found in Lib/_pydecimal.py). I see concretely that it tries to import _decimal and only imports _pydecimal on ImportError.
I wouldn’t know how to run (for example) both the C version of abs() and the python version in the same program.
The “official” method is to set the C version of the module to None in the sys.modules cache so that it incurs an ImportError when the Python version tries to import the C version:
import sys
import _bisect as c_bisect
sys.modules['_bisect'] = None
import bisect as py_bisect
print(c_bisect.bisect_right) # <built-in function bisect_right>
print(py_bisect.bisect_right) # <function bisect_right at 0x0000023164AE7C40>
It’s “official” because it’s how the test module does it: