The question, how many integers $n$ are there, say with $n\le x$, such that $n^2+1$ is squarefree,
has been studied a lot. For references see the article of Heath-Brown: arxiv.org/pdf/1010.6217

It is easy to construct intervals $(x, x + c \log x]$ with a small positive constant
$c$, such that $n^2 + 1$ has a non-trivial square factor for every $n$ in the interval.

As the example $n=239$ shows, $n^2+1=57122=2\cdot 13^4$ is not squarefree.

In the question here, $n=2^a-1$ is of a special form. Then $n^2+1$ is "very often" squarefree, for smaller $a$,
not depending on whether $n$ is a Mersenne prime or not. On the other hand, this should not hold in general.

Edit: I just saw that there is a counterexample also for Mersenne primes: $p=2^{2203}-1$, given by Stefan Kohl.

It may be difficult to give an answer in general for such questions, though - see Square free sum of two squares.