The reason for the two conventional uses of $^{-1}$ is that what they invert are written very similarily. In fact, in many settings, composition of two functions is actually written exactly like multiplication.
For instance, multiplying matrices corresponds to composing linear maps, so we often see composed linear maps written next to one another without a symbol between, as though we're multiplying. And when working with symmetry groups, a composition of two permutations is also often written by writing them next to one another without a symbol in-between.
So, seing as how composition of functions is often written like multiplication, it is not that difficult to see why the compositional inverse is also written the same way as the multiplicative inverse.
I would love for there to be a consistent way to differentiate between the two, but there isn't. At least not any widely used convention. Also, in some cases, like in my two examples above, it would mean you have to decide, every time you want to invert an object, whether that object is a function to be composed, or an element of a group or monoid to be multiplied, when really, you want it to be both at the same time.