What side effects, if any, are there from issuing scutil --set HostName 'Fred'?
If you haven't already set the HostName yourself using scutil, /bin/hostname is probably reporting the result of a reverse DNS lookup on your computer's IP address. Both the IP address and the result of the reverse DNS lookup will likely differ based on the network you're connected to, and can easily change over time on the same network, too.

scutil --set HostName foo is a persistent setting, and unlike LocalHostName and ComputerName, HostName cannot be set in the GUI. For that reason, some advise against setting HostName. In my opinion, as long as you don't get confused if you try to make changes through the GUI later, setting your HostName is unlikely to cause any negative side effects for you. However, if you do run into issues, it's easy to undo with scutil --set HostName ''.