I wonder if pywikibot supports that. If so, we should upgrade to use the feature.
WARNING: API warning (login): Main-account login via "action=login" is deprecated and may stop working without warning. To continue login with "action=login", see Special:BotPasswords. To safely continue u
sing main-account login, see "action=clientlogin".
WARNING: API warning (main): Subscribe to the mediawiki-api-announce mailing list at https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce for notice of API deprecations and breaking changes. U
se Special:ApiFeatureUsage to see usage of deprecated features by your application.