Sage supports free monoids and free abelian monoids in any finite number of indeterminates.
Monoids
Enter search terms or a module, class or function name.