Sorry, I was apparently a bit careless in the original post. What I am actually seeing upon closer inspection is that the comments are counted as empty tags, i.e. #, in the tag pane. They do appear as code in the actual file where they are typed as you show.
I realised as I was typing this answer that what is happening is that somewhere I have a piece of code, outside of quotation marks, therefore an empty tag has been created for comments like ā# a python commentā. When clicking this in the tag pane it apparently finds ALL mentions of a hashtag.
Screenshots of my current situation on the OSX app.
As it looks in the document:
When going to tag pane and clicking the empy tag ā#ā I get that note (among other files I have as search results)