Disable decorators and wrappers when not __debug__

When python is called with -O, it optimises the code and
sets __debug__ to False, which may be used to disable
blocks of code not suitable for an optimised tool.

This patch disables decorators and wrappers, which provide
deprecation facilities or check the server version and user
rights before performing an operation.  In optimise mode
the caller must explicitly login, avoid deprecated arguments,
check the server versions & features.

epydoc can be generated using:

    python -O /usr/bin/epydoc pywikibot

Bug: 72424
Change-Id: I67ed6b3e79ac46ef92e2b08ef6c606fd7177bae2
Merge "Disable decorators and wrappers when not __debug__"