How to reconstruct a complicated built-in function (e.g. for modification or use in a version that does not have it yet)

Is it possible to extract the definitions for a built-in function to reconstruct a similar user defined function. This would be useful to port new mathematica functionality to older versions or to create modified versions of built-in functions.

I found that

Needs["GeneralUtilities`"] PrintDefinitions[symbol]; 

could get us close (see but it would still be quite a job to reconstruct the full function including all of its dependencies from there. Have there been any automated attempts to try this kind of thing?

As an example I would be very interesting in reconstructing ExternalEvaluate (or if that is too ambitious to reconstruct only the part that converts Mathematica arguments supplied with "Arguments"->{args} to python expressions in the case that we ExternalEvaluate using a python session.)

(I hope this type of question is not frowned upon in light of copyright issues. I would just like to deal with incompatibility issues between different (Licensed) versions of Mathematica.)