It seems standard texts fail to take into account the algebraic modelling by the theory of groupoids.
There is a nice construction introduced by Philip Higgins, see his downloadable book Categories and Groupoids, Chapter 8, in which you start with a groupoid $G$ and a function $f: Ob(G) \to Y$ where $Y$ is any set. Then there is a groupoid which he writes $U_f(G)$ with object set $Y$ and with a universal property for morphisms $G \to H$ whose function on objects factors through $f$. Thus $U_f(G)$ is obtained from $G$ by "identifying certain objects of $G$", and perhaps adding some. This construction includes that of free groups, and of free products of groups.
The topological interpretation in terms of the fundamental groupoid $\pi_1(Z,C)$ of a space $Z$ for a set $C$ of base points is given on p.343, 9.1.2 (Corollary 3) of Topology and Groupoids, and was in the 1968 edition of this book.
This answers the special case of the question, as given by Mariano.
Later: I think also that my and other, answers to this mathoverflow question on many base points and groupoids are relevant.