Homepage doesn't have canonical URL

The only possible reason I can see for this regarding the “home” page is for “link and ranking signals” when

Your server is configured to serve the same content for the www subdomain or the http protocol.

But this can be more easily achieved on an individual basis without touching any Discourse code.

Set your preferred domain
Tell Google which version of your site’s URL you prefer for your domain: