bpo-39353: Deprecate the binhex module (GH-18025)

Deprecate binhex4 and hexbin4 standards. Deprecate the binhex module
and the following binascii functions:

* b2a_hqx(), a2b_hqx()
* rlecode_hqx(), rledecode_hqx()
* crc_hqx()
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst
index 98d8679..aa2a270 100644
--- a/Doc/library/binascii.rst
+++ b/Doc/library/binascii.rst
@@ -92,6 +92,8 @@
    The string should contain a complete number of binary bytes, or (in case of the
    last portion of the binhex4 data) have the remaining bits zero.
 
+   .. deprecated:: 3.9
+
 
 .. function:: rledecode_hqx(data)
 
@@ -104,11 +106,15 @@
    .. versionchanged:: 3.2
       Accept only bytestring or bytearray objects as input.
 
+   .. deprecated:: 3.9
+
 
 .. function:: rlecode_hqx(data)
 
    Perform binhex4 style RLE-compression on *data* and return the result.
 
+   .. deprecated:: 3.9
+
 
 .. function:: b2a_hqx(data)
 
@@ -116,6 +122,8 @@
    argument should already be RLE-coded, and have a length divisible by 3 (except
    possibly the last fragment).
 
+   .. deprecated:: 3.9
+
 
 .. function:: crc_hqx(data, value)
 
@@ -124,6 +132,8 @@
    *x*:sup:`16` + *x*:sup:`12` + *x*:sup:`5` + 1, often represented as
    0x1021.  This CRC is used in the binhex4 format.
 
+   .. deprecated:: 3.9
+
 
 .. function:: crc32(data[, value])
 
diff --git a/Doc/library/binhex.rst b/Doc/library/binhex.rst
index 2966e0d..7de6a66 100644
--- a/Doc/library/binhex.rst
+++ b/Doc/library/binhex.rst
@@ -6,6 +6,8 @@
 
 **Source code:** :source:`Lib/binhex.py`
 
+.. deprecated:: 3.9
+
 --------------
 
 This module encodes and decodes files in binhex4 format, a format allowing
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 00341ef..0e82ff0 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -353,6 +353,16 @@
   deprecated and will be removed in version 3.11.
   (Contributed by Yury Selivanov and Kyle Stanley in :issue:`34790`.)
 
+* binhex4 and hexbin4 standards are now deprecated. The :`binhex` module
+  and the following :mod:`binascii` functions are now deprecated:
+
+  * :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`
+  * :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`
+  * :func:`~binascii.crc_hqx`
+
+  (Contributed by Victor Stinner in :issue:`39353`.)
+
+
 Removed
 =======