How can i cast a inventory system to all of my characters?

Technically correct and not very helpful answer is to create layer of abstraction. You need to make parent character with basic interaction with inventory and inherit other characters from it, specifying interaction for each character if needed.