I've started to play with mechanizing some set theory stuff. I'm not sure if I want a constructive flavor or not yet.
Anyhow you can do stuff like axiomize the empty set
$$ \top \vdash \exists P. \forall x. x \notin P$$
But you seem to need something like Hilbert's epsilon for making definitions.
$$ \emptyset = \varepsilon P. \forall x, x \notin P $$
Then you prove that the empty set really is empty $\top \vdash \forall x, x \notin \emptyset $ by applying the empty axiom and substitute existential quantification with epsilon.
I'm not sure how constructive this is and this complicates implementation concerns like capture avoiding substitution. Also to be honest I'm not really familiar with using epsilon style quantifiers.
It might help a little to add let binders but that isn't really the same issue. I don't really want to prove $\top \vdash \textbf{let} \, \emptyset = \varepsilon P. \forall x, x \notin P \, \textbf{in} \, \forall x, x \notin \emptyset $
I'm not sure why but you don't really seem to run into the same sort of problem with type theory.
It's kind of weird because you can hand-wave the issue with axiomatic set theory by saying that whenever we mention the empty set in a theorem $\top \vdash P$ we really mean $\top \vdash \exists \emptyset, (\forall x, x \notin \emptyset) \wedge P(\emptyset)$.