It is probably possible to store the internal state of hash(tr) before storing m in order to some gas. See [here](https://github.com/ZKNoxHQ/ETHDILITHIUM/blob/d62d7cdaf8fbdd41e2f2cf728c24d8d120b5ad28/python-ref/dilithium_py/dilithium/dilithium.py#L300C8-L300C44).
It is probably possible to store the internal state of hash(tr) before storing m in order to some gas.
See here.