Qitem.editEntity(commands, summary='foo bar baz')

seems to be the way to go, commands is the "data" parameter of the API at https://www.mediawiki.org/wiki/Wikibase/API#wbeditentity

here a dump of a working version of https://paws.wmflabs.org/paws/user/Marsupium/notebooks/normalize%20references.ipynb as of 2018-10-30T16 as a backup:


following comes a test of the query length limit (using POST):