Optimizing site speed by localizing paths

This is nonsense. Almost all URL getters are a result of get_option(), eg. get_option('stylesheet_root'), get_option('template') and so on.

These options are loaded very early during the request, they are cached and not fetched again.

Since the options are fetched anyway, all you can improve is processing time. Nanoseconds. This isn’t worth the trouble. Just compare to the time you need when you have t change something in all those files (switching to HTTPS, to a sub-domain, changing permalinks).

Install a good caching plugin. That will improve load time much, much more.