Deepfreeze essential parts of the encodings module. ### Description

This is a split off from #3582.

Deepfreeze essential parts of encodings module (encodings.\__init__, encodings.utf_8, and encodings.aliases), which is required during the Python bootstrap.

diff --git a/cardenc/pycard.cc b/cardenc/pycard.cc
index c4d2ead..a0a30db 100644
--- a/cardenc/pycard.cc
+++ b/cardenc/pycard.cc
@@ -11,6 +11,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <Python.h>
 
 #include "card.hh"
@@ -122,8 +123,14 @@ static struct PyModuleDef module_def = {
 	NULL,              /* m_free */
 };
 
+static volatile int *_dummy_malloc;
+
 PyMODINIT_FUNC PyInit_pycard(void)
 {
+	_dummy_malloc = (int *)malloc(sizeof(int));
+	*_dummy_malloc = 1;
+	free((void *)_dummy_malloc);
+
 	PyObject *m = PyModule_Create(&module_def);
 
 	if (m == NULL)
diff --git a/solvers/pysolvers.cc b/solvers/pysolvers.cc
index a198f43..d45639b 100644
--- a/solvers/pysolvers.cc
+++ b/solvers/pysolvers.cc
@@ -15,6 +15,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <vector>
 
 #ifdef WITH_CADICAL
@@ -643,8 +644,14 @@ static struct PyModuleDef module_def = {
 	NULL,              /* m_free */
 };
 
+static volatile int *_dummy_malloc;
+
 PyMODINIT_FUNC PyInit_pysolvers(void)
 {
+	_dummy_malloc = (int *)malloc(sizeof(int));
+	*_dummy_malloc = 1;
+	free((void *)_dummy_malloc);
+
 	PyObject *m = PyModule_Create(&module_def);
 
 	if (m == NULL)

diff --git a/cardenc/pycard.cc b/cardenc/pycard.cc
index c4d2ead..a0a30db 100644
--- a/cardenc/pycard.cc
+++ b/cardenc/pycard.cc
@@ -11,6 +11,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <Python.h>
 
 #include "card.hh"
@@ -122,8 +123,14 @@ static struct PyModuleDef module_def = {
 	NULL,              /* m_free */
 };
 
+static volatile int *_dummy_malloc;
+
 PyMODINIT_FUNC PyInit_pycard(void)
 {
+	_dummy_malloc = (int *)malloc(sizeof(int));
+	*_dummy_malloc = 1;
+	free((void *)_dummy_malloc);
+
 	PyObject *m = PyModule_Create(&module_def);
 
 	if (m == NULL)
diff --git a/solvers/pysolvers.cc b/solvers/pysolvers.cc
index a198f43..d45639b 100644
--- a/solvers/pysolvers.cc
+++ b/solvers/pysolvers.cc
@@ -15,6 +15,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <vector>
 
 #ifdef WITH_CADICAL
@@ -643,8 +644,14 @@ static struct PyModuleDef module_def = {
 	NULL,              /* m_free */
 };
 
+static volatile int *_dummy_malloc;
+
 PyMODINIT_FUNC PyInit_pysolvers(void)
 {
+	_dummy_malloc = (int *)malloc(sizeof(int));
+	*_dummy_malloc = 1;
+	free((void *)_dummy_malloc);
+
 	PyObject *m = PyModule_Create(&module_def);
 
 	if (m == NULL)
