$\newcommand\dom{\mathit{dom}}\newcommand\codom{\mathit{codom}}\newcommand\Ar{\mathit{Ar}}\newcommand\Ob{\mathit{Ob}}\newcommand\Hom{\mathit{Hom}}\newcommand\bHom{\mathbf{Hom}}\newcommand\vertex{\mathit{vert}}\newcommand\edge{\mathit{edge}}$As far as I know, it is clear in the mind of every category theorists (at least, the ones of my acquaintance) that, a category $\mathcal{C}$ comes with the usual axioms and two (mono-valued) maps $\dom$, $\codom$ from the class $\Ar(\mathcal{C})$ to the class $\Ob(\mathcal{C})$ so that if $f\in \Hom_{\mathcal C}(X,Y)$ is given we have $\dom(f)=X$, $\codom(f)=Y$. Now, if 
$$f\in\bHom_\mathcal{C}(Y,Z)\cap\bHom_\mathcal{C}(Y',Z')$$ 
and 
$$g\in\bHom_\mathcal{C}(X,Y)\cap\bHom_\mathcal{C}(X',Y')$$
we must have $X=X'$, $Y=Y'$, $Z=Z'$. 
The situation is very much like in graph theory, for the definition of a Directed Multigraph, a Quiver or an Automaton. I pick the definition in [1]. 

_A Graph (understand Directed Multigraph) $\Gamma$ consists of a set $X=\vertex\Gamma$ and a set $Y=\edge\Gamma$ and two maps $o:\ Y\to X$ (origin) and $t:\ Y\to X$ (target)._  

This issue is explicitly unearthed and treated in [2] page 11 Remark 1.1.2 (e) 

“If $f ∈ \mathcal{A}(A, B)$, we call $A$ the **domain** and $B$ the **codomain** of $f$. Every
map in every category has a definite domain and a definite codomain. (If
you believe it makes sense to form the intersection of an arbitrary pair of
abstract sets, you should add to the definition of category the condition that
$\mathcal{A}(A, B) \cap \mathcal{A}(A', B') = \emptyset$ unless $A = A'$ and $B = B'$.)”
 
The (mono-valued) functions are sometimes explicitly set up in the building axioms, see [3] page 11 definition 1.1.1 and, starting from axioms from which the MO could legitimately interpret these “functions” as “constructed” whereas they are “thought” as univalued (it is explicit in Serre) in the mind of many category theorists, one can repair this deficiency with triplets as in [4], page 22 **Remark 3.2** point (3). I think this last construction can overcome the last construction you mention. 

---

[1] Jean-Pierre Serre (1977), [_Trees_](https://doi.org/10.1007/978-3-642-61856-7), Springer.

[2] Tom Leinster, [_Basic Category Theory_](https://doi.org/10.1017/CBO9781107360068), Cambridge University Press (2014).

[3] Emily Riehl, _Category theory in context_,  Cambridge University Press (2014).

[4] Jiřı́ Adámek, Horst Herrlich, and George E. Strecker, 
[_Abstract and Concrete Categories, 
The Joy of Cats_](http://katmat.math.uni-bremen.de/acc/acc.pdf).