As shown by @NoamD.Elkies here, $\sum_{n \leq x} d(kn)$ can be reduced to a linear combination of values of $D$ at multiples of $x$ (where $D(x)=\sum_{n\leq x}d(n)$ is the sum of the number of divisors less than $x$), so \begin{align} &\sum_{n \leq x} d(pn) = 2D(x) - D(x/p), \ p\in\mathbb{P}\\ \end{align}
which gives us
\begin{align} &\sum_{n \leq x} d(2n) = 2D(x) - D(x/2)\sim x (3 \log (x)+6 \gamma -3+\log (2))/2\\ &\sum_{n \leq x} d(3n) = 2D(x) - D(x/3)\sim x (5 \log (x)+10 \gamma -5+\log (3))/3\\ &\sum_{n \leq x} d(5n) = 2D(x) - D(x/5)\sim x (9 \log (x)+18 \gamma -9+\log (5))/5\\ &\vdots \end{align}
but for composite $k$ things seem a little less straightforward:
\begin{align} &\sum_{n \leq x} d(4n) = 3D(x) - 2D(x/2)\sim x (2 \log (x)+4 \gamma -2+\log (2))\\ &\sum_{n \leq x} d(6n) = ?\\ \end{align}
How can $\sum_{n \leq x} d(6n)$ be written in this form? Is there a general way to find the linear combination for composite $k$?
$\sum_{n\leq x} d(6n) = 4D(x) - 2D(x/2) - 2D(x/3) + D(x/6)$, which should suggest the general pattern for $k$ squarefree.