I have some experience with python and starting to learn Javascript. I know that python has some modules to easily open and communicate with anoter processes/python scripts. Javascript seems to only be able to do this with http requests or using localhost.
So I was thinking, do the python modules and all other IPC implementations use localhost inside their code, even if it doesn't appear in the 'surface'.
Is this approach really fast and effective?
If it's not the only one, how do other IPC implementations work?
Javascript uses (mostly) only TCP sockets.
Python can use TCP sockets & Unix sockets. You are probably thinking of Unix sockets -- Unix sockets do not use hosts, they work within the local filesystem hierarchy.
For this reason they can potentially offer better performance.