For a computer application, I would suggest you avoid all ambiguity by forcing the user to type
$$
(\sin x)^2
$$
for $\sin^2(x)$, and
$$
\arcsin x
$$
for the inverse function. Don't allow $\sin^n (x)$ as it is abusive shorthand which has done more to confuse people than help.
However, it's also worth noting that Wolfram Alpha interprets $\sin^{-2}(x) = \frac{1}{(\sin x)^2}$, whereas $\sin^{-1}(x) = \arcsin x$. More generally, it appears that $n = 1$ is a special case in $\sin^n(x)$ and otherwise it is interpreted as $(\sin x)^n$.
The reason $\sin^n(x)$ is bad notation for $(\sin x)^n$ is that in most contexts, $f^n(x)$ means the $n$th iterate of $f$.
In particular, the $-1$th iterate of an invertible function is the inverse,
so $\sin^{-1}$ would actually be a natural way to denote $\arcsin$.
On the other hand, the problem with $\sin^{-1}(x)$ for $\arcsin$ is of course that it conflicts with the hugely widespread notation $\sin^2(x)$.
You really can't win.