I am fitting the t-distribution to log-returns numerically (not using R, MATLAB, Stata, etc.), but rather using general programming. Assuming the log-return values are $r_t$, and the $t$-variates are $x_t$, then given $r_t=ax_t + b$, and knowing the variance of t-distribution, $\nu/(\nu-2)$, the variance of $r_t$ becomes $\sigma^2(r_t)=a^2(\nu/(\nu-2))$. Would the parameters to fit for the $r_t$ then be $b$, the location, and $a=\sqrt{\sigma^2(r_t)/(\nu/(\nu-2))}$, where $\sigma(r_t)$ is the measured standard deviation of the observed log-return?
The solution would be to first initialize $a=1$ and $b=0$ and then calculate
$$ \hat{r_t}=x_t=\frac{r_t-b}{a}=\frac{r_t-b}{\sqrt{\frac{\sigma^2(r_t)}{\frac{\nu}{\nu-2}}}} $$
with minimization of $MSE=\frac{1}{T}\sum_t (r_t-\hat{r}_t)^2$ ?