I recently learnt that finite groups are cancellable from direct products, i.e. if $F$ is a finite group and $A\times F \cong B\times F$, then $A \cong B$. A proof can be found in this note by Hirshon. In the same note, it is shown that $\mathbb{Z}$ is not cancellable, but if we only allow $A$ and $B$ to be abelian, it is (see here).
I would like to know if there are any groups that can be cancelled from free products rather than direct products. That is:
Is there a non-trivial group $C$ such that $A*C \cong B*C$ implies $A \cong B$?
If it helps, I would also be interested in the case where the groups are finitely generated.
It is certainly not true that every group is cancellable in free products. For example, if $A$, $B$, $C$ are the free groups on one, two, and infinitely many generators respectively, then $A*C \cong C \cong B*C$ but $A\not\cong B$. Many non-examples can be constructed this way, but they are all infinitely generated. This leads to the question:
Are there finitely generated groups $A, B, C$ with $A \not\cong B$ but $A*C \cong B*C$?