message: Make CPython implementation function type-correct, which removes UB from calling a function through a pointer of the wrong type, and also removes a C-style cast.
diff: @@ -72,10 +72,11 @@ struct TensorReleaser {
  extern PyTypeObject TensorReleaserType;
  -static void TensorReleaser_dealloc(TensorReleaser* self) {
  +static void TensorReleaser_dealloc(PyObject* pself) {
  + TensorReleaser* self = reinterpret_cast<TensorReleaser*>(pself);
  (*self->destructor)();
  delete self->destructor;
  - TensorReleaserType.tp_free(self);
  + TensorReleaserType.tp_free(pself);
  }
  PyTypeObject TensorReleaserType = {
  @@ -84,7 +85,7 @@ PyTypeObject TensorReleaserType = {
  sizeof(TensorReleaser), /* tp_basicsize */
  0, /* tp_itemsize */
  /* methods */
  - (destructor)TensorReleaser_dealloc, /* tp_dealloc */
  + TensorReleaser_dealloc, /* tp_dealloc */
  nullptr, /* tp_print */
  nullptr, /* tp_getattr */
  nullptr, /* tp_setattr */
  