Refs #23323 -- Allow the use of translation.override as a decorator

This PR allows the use of `translation.override` as a decorator, as suggested in https://code.djangoproject.com/ticket/16690#comment:2

Although a comment in this ticket suggests that it is not useful, I have experienced several cases where it is. For instance, I have some functions which are sending mail and I want those mails to be translated in some default language which is not the one of the user doing the action. Having the function decorated is better in terms of readability than a long `with` statement which introduces heavy indentation.

When turning `translation.override` into a `decorator`, I realized there was some duplicated code in Django doing exactly what a `ContextDecorator` (https://docs.python.org/3/library/contextlib.html#contextlib.ContextDecorator) is doing. The first commit backports a simple implementation of `ContextDecorator` and uses it where appropriate.
Yep. Done.