Yes: for option A it is best to create a child theme and add the content to the functions.php file. You could create a very basic child theme with the minimum required files.
You could also create a plugin and add the content from option A. A great plugin to create a plugin is Pluginception and can be found on the official WordPress plugin repo here
The benifit of this is that you can change theme whenever you like and keep the plugin running.