I wanted an easy way to manipulate objects. Having already programmed KiPadCheck, LayerViewSet, and beginning on KiSelect, I started to see that even some of the basic operations in python are not that easy. And that some people would never learn how to do things in python.
I also noticed I would type the same commands in the Scripting Console to accomplish some basic things like selecting or deselecting all objects (to help debugging my other KiCad tools).
Then I realized that instead of defining some fixed commands in python, I could chain them together if I wrote a simple stack-based processor (the processing started out as 8 lines of python, it's now 50 lines of python including defining new commands).
Then based on @Sprig's comment and starting with the REJOIN command, i realized that there could be great application in manipulating shapes in KiCad since KiCad doesn't really support polygons of any sort, a feature could have used as well.
There is also the possibility of sharing command strings, since they are so much more compact than any equivalent python.
So this started out as a sequence of "I wish I had something that could make that easy" to "hmmm, can I do this in a more general way" to "I wonder if this might be useful to anyone else" to "I think I can add even more useful stuff as commands".
So not really an original intent, but an exploration of the space of what's possible to make simple scripts a little more accessible.
An example of the simplicity of using command_stack. Here is how to select all Module References in command_stack (at some point there will be a command line dialog):
MODULES GetReference CALL SETSELECT
Here is the same thing in python:
for module in pcbnew.GetBoard().GetModules():
There's not a big difference here to an experienced programmer. But to someone who has never programmed, the first is a LOT easier.
Edit: formatting, added example