The alternative way of using addModule is, as far as I can see, not new (since KF 5.84) and thus "safe" to use.