If you are building something like a shortcode, or adding one it, it is highly recommended to put that functionality into a WP Plugin. While that “making a plugin” probably sounds super hard, it is actually really easy.
With something like a shortcode, you generally do not want to build them into themes (if that is even what you are looking to do).
Explains everything, how to set it up, for a shortcode, I would recommend the /mu-plugins/ (option 1) which will make it theme independent, always “on”, and you don’t have to look at it in your plugins list. :P