@BenjaminHan I may have a look at this when I get some time. looks like the mathstodon fork is available on github, so there may not be much work to do provided that we trust their implementation!
https://github.com/christianp/mastodon/tree/mathstodon-3.5.3