There is no need to modify anything Do it as it should do…
Install Code Snippet or similar and do that through it (sure, you can do it as a separate plugin if you prefer that; no differences). Totally same thing than installing a theme component or a plugin to Discourse.
And use functions.php of child theme only when modification is theme dependent. It is not the case this time.