If we can find the module name where foo is defined, then check if the appropriate foo.pyx file is available. Load it. Find the function. Figure out which if it is defined twice. Show all if we can't figure it out.
If totally screwed and we can't even find the file, then modify pyrex so it embeds extra info in the docstring. Strip that out on displaying.
See About this document... for information on suggesting changes.