I started doing exactly this. Write a bunch of functions, that may end up in different systems, on different machines, even. This allows you to define the interfaces, figure out data dependencies, and so on.
The code may be runnable, just printing out some statements. Then I copy blocks of it to the place where it will belong.
It’s more of a thinking tool, than “actual code”.
Same. Really happy with it.