I think math education is to blame for deceiving people that the way things are written down is more important than what it actually means. I was once a victim of this kind of ignorance.
There are two ways to interpret $\frac d{dx}$. An algebraic way is what is usually understood by students new to calculus. As an example, let's say $f(x) = x^2 + x$. Then $\frac{df(x)}{dx}$ has the following meaning
\begin{align}
\frac{df(x)}{dx}
& = \frac{d(x^2 + x)}{dx} & & \text{by substituting the expression $f(x)$}\\
& = 2x + 1 & & \text{by the algebraic rule of differentiation}.
\end{align}
$f(x) = x^2 + x$ here is viewed as a "formula". Meaning once the symbol "$x$" is supplied to $f$, it yields an expression "$x^2 + x$". Then, $\frac{d}{dx}$ operates on the expression $x^2 + x$. The symbol $x$ is important -- as in, if we compute $\frac{df(x)}{dy}$, the result should be $0$.
Another way to interpret $\frac d{dx}$ is analytic. Meaning $f$ is defined as a function, say from $\mathbb R \to \mathbb R$ (the domain is not very important here), such that for any real number $x$, $f(x)$ is another real number equal to $x^2 + x$, where squaring and addition of real numbers have their usual meanings. We use the same expression to describe $f$: "$f(x) = x^2 + x$". This definition of $f$ is not a definition of a "formula", but a definition of a "function". Then, $g = \frac{df}{dx}$ is defined as a function from $\mathbb R$ to $\mathbb R$ via the limit operation: $g(x) = \lim_{\tilde x \to x}\frac{f(\tilde x) - f(x)}{\tilde x - x}$. Note that the symbol $x$ in $\frac{d}{dx}$ is actually not important there, as the expression "$f(y) = y^2 + y$" would define the same function $f$.
A more accurate notation for analytic interpretation should be just $Df$ instead of $\frac{df}{dx}$ because insisting on using the symbol $dx$ may contradict the algebraic interpretation in some cases. As an example, let's say we define $f$ by $f(y) = y^2 + y$. What would $\frac{df(z)}{dx}$ be? The algebraic interpretation would give $0$ because there is no appearance of $x$ in the formula $f(z)$. The analytic interpretation, however, would give a function defined by $\xi \mapsto 2\xi + 1$. (I just picked an arbitrary symbol $\xi$ for a dummy variable.) Nonetheless, good authors would avoid this situation completely. That means they will never write something like $\frac{df(y)}{dx}$ unless $y$ is also a function of one variable. Also, the definition of $y$ would involve $x$ as a dummy variable, not any other symbols.
The problem is that most introductory calculus courses start with the analytic definition, but later encourage algebraic interpretation. Some even teach notation like $$
(x^n)' = nx^{n-1},
$$
which is correct algebraically, but is rather meaningless in the strict analytic sense. This is acceptable by most mathematicians though. One way to view this equation as meaningful analytically is to accept the following abuse of notation: $x^n$ actually means a function defined by $x \mapsto x^n$. Written out in full, the above equation means
$$
D(x \mapsto x^n) = (x \mapsto nx^{n-1})
$$
where we agree beforehand that the notation "$x \mapsto \ldots$" is a function from $\mathbb R$ to $\mathbb R$. This equation implies that $D$ takes a function and spits out a function. An equivalent way to state the same thing is
$$
D(x \mapsto x^n)(y) = ny^{n-1}.
$$
$y$ is a dummy variable that is chosen different from $x$ to avoid confusion with $x$.
Going back to the original question, writing $z = re^{i\theta}$ means $z: \mathbb R^2 \to \mathbb C$ is a complex-valued function of two real variables. More formally, $z$ is defined, as a function, by
$$
z(r, \theta) = re^{i\theta}.
$$
The statement that $f(z) = P(r, \theta) + iQ(r, \theta)$ actually means
$$
(f \circ z)(r, \theta) = P(r, \theta) + iQ(r, \theta).
$$
The abuse of notation here is $\frac{\partial f}{\partial\theta} = D_2(f \circ z)$, where $D_2$ is defined as the partial derivative operator in the second parameter. More specifically, for any function $g$ of two variables,
$$
(D_2g)(x, y) = \lim_{\tilde y \to y}\frac{g(x, \tilde y) - g(x, y)}{\tilde y - y}.
$$
$x$ and $y$ here are dummy variables. I can replace them with any symbols, like $r$ and $\theta$.
The chain rule says that
$$
D_2(f \circ z)(x, y) = Df(z(x, y)) \cdot (D_2z)(x, y)
$$
This translates back into the lazy notation as
$$
\frac{\partial f}{\partial\theta}
= \frac{df}{dz} \cdot \frac{\partial z}{\partial\theta}.
$$
The symbol $\frac{\partial f}{\partial z}$ could be considered the same as $\frac{df}{dz}$ in the lazy notation because $f$ is a function of only one variable. However, when $f$ is a function of just one variable, it is quite unusual to use $\partial$ instead of $d$.