What is the best way to compress a string with only numbers and commas in it?
Treat this as a base-11 number (the comma is treated like the digit "10").  Convert the base-11 number to binary, and use the resulting binary string as the compressed version of your data.

This will be close to optimal.  It falls short of optimal only in that it does not take into account the guarantee that every number in the list will have at most 3 digits -- but even taking that into account would not improve the compression ratio much.

The absolute best method will depend on the distribution of data that you will be compressing; but I expect this will be close to optimal for most real-world distributions.