As you might need to call another function inside of our procedure that mutates some data.
But i think there are some sort of problems we are imposing to ourselves just because we need to deal with the millions possible ways a data could be laid out or modeled based in our type-system centric world.
In my perfect world, we should model functions in a DNA fashion, so function is also data, and if is mutable, could even be changed by the data depending of the what is in it.
First, we would never have to re-create a function again, and if we do, the data signature would be exactly the same as the other one created before, so we can match in a index for instance.
Im more inspired by the way things are done in the natural world, than the way we ended up shaping math (where the concepts of FP are more based on).
The fact that we are creating arbitrary abstractions to represent data and imposing to others is actually the core issue here.
Supose we could set up the representation for the most things as a matrix. colors, words, sound, etc..
Than you can filter and process applying linear algebra, ML, etc..
I fell that the way we pack bytes, in arbitrary fashion, by mixing types is a core impediment for us to have a better experience with the program/data duality.
But i guess that all of this data centered, AI focused world will make us understand a better way to deal with both programs and data. The need to make our ML agents understand our world will probably change the way we deal with code and data.