Python API security

Krita once tried having something like that and you are not the first with that idea. We discussed this already in different topics but until now, no one really had an idea for a satisfying solution.