My approach

Bookmark of the one and only Colab-Notebook Untitled.ipynb for everything. Prototype new ideas, and nowhere else.
Decide from time to time: a) Delete notebook cells because it’s rubbish, or b) keep it
If 2b) start to add docstring and dream up some possible unit tests in Colab (e.g. checking dimensions of intermediate results)
Start coding an actual python package with unit tests, setup.py, and so forth.

Step 1 is what I would call “data science” or “ml research”. With step 3 and 4 we enter software development or “ml engineering” territory. Imo it’s best to stay as long as possible in step 1 and 3 where creativity happens (=changes), what you don’t really want in step 4 anymore.