Wolfram mathematica has a closed source model, but must give documentation to all its functions. Could a LLM be trained to port this into a Python equivalent?
No, but that's not a limitation of the LLM technology. Python is imperative and Mathematica is declarative. You could get pretty far, but ultimately you'll run into roadblocks.
It's $400 for a home license; $1,800 if you're a company for Mathematica. Given the work that's fine into it, if you're finding it useful and deriving revenue from it, isn't it worth it to just buy it?