I see Update composition and Rename composition actions here, but no Create composition or something like that. Is it possible to add compositions via Python?
You can do it via calling the GUI
from krita import *
qdock = next((w for w in Krita.instance().dockers() if w.objectName() == 'CompositionDocker'), None)
compName = qdock.findChild(QLineEdit,'saveNameEdit')
compSave = qdock.findChild(QToolButton,'saveButton')
#this is optional if you want to give it a name
compName.setText('Name of Composition')
compSave.click()