Albeit this is anti-pattern and you can really just use a service and inject it to your components as a dependency (preferred), but if you really want to do it via global variable you can do so by attaching your function / object to the global "window" object.
Every browser has a global window object available.
At the top of your main.ts file you can add this line:
declare var window: any;
window.c = console
Basically what it does is that it attaches the console object to the "c" field of window object. You can just use it then anywhere globally:
c.log("Hello World")
Do note that I added it in the main.ts file because that's where an angular application gets started. But you can add these anywhere you need (but the instantiation time will differ on where you have added it into) and it should be available globally.