Is it possible to configure the drive via Python instead of using MotionLab3?
Of course, Motion Lab is only intended to ease the configuration, but by no means is the exclusive method.
To do this with Python, check the documentation the Ingeniamotion set of libraries.
https://pypi.org/project/ingeniamotion/
Under Communication — ingeniamotion 0.7.1 documentation (ingeniamc.com), you see get_register and set_register to configure the drive.