@ironstone welcome to the KNIME forum
You could put your function into a module and import that into a KNIME/Python node. You would have to do that in every one of them but you only would have to write the function once. You could also feed parts of a Jupyter notebook into KNIME tagging the relevant parts.
Then you can of course save and pickle all sorts of data (1|2|3) but I don’t think custom code and functions can be transfered that way.
I have not yet tested the new Python Script with all the new ports extensively.