Actually, if you’ve used this method, you’ve already tried it.
The only difference between mine and the one you liked to is the use of base64 or utf-8 encoding. Because svg is text, you can just use utf-8 and it will work (works great if you’re doing some server-side or JS programming to change colours or something).
Base64 won’t hurt either. Cool thing about base64 is that you can do it to almost any file. You could encode small png/jpg/gif files and include them the exact same way.
Number of added lines can be an issue on complex svgs/images, but if you run it through an optimizer like svgomg, you’ll probably be okay. The main benefit to inline files like this is that it reduces the number of files that need to be downloaded… which can actually speed up your initial load time. Downside? It doesn’t cache and is downloaded every single time.