It depends. My thoughts:
If it's not clear whether statistical expertise is needed to answer it (or might otherwise be on topic), we would typically need to clarify first because clarifying that to be the case would make it on topic.
If it's about software with no statistical expertise required but it's not a clear question, we can't migrate it. If it is clear, and is otherwise on-topic elsewhere (say at StackOverflow or SuperUser) then we can migrate, so that's a good reason to clarify first. It's better to migrate a question than have it closed here and reposted elsewhere, as long as it's not just going to close at the destination.
if it's about software with clearly no statistical expertise required but it's very unlikely to end up migratable, just close it as whichever you think is the biggest problem with the question (closure is intended to be a signal to the poster to improve the question; otherwise we'd just delete all the unsatisfactory questions).
It's not always obvious what's the best close option, but in many cases I'd prefer to clarify first if it's not pretty clear.
On occasion I have reopened questions I thought were at least reasonably likely to require statistical expertise, in order to seek clarification of that. Sometimes that turns out to be the case and sometimes it doesn't.
[We should be careful -- I note that a few users have a tendency to vote to close a question that uses a language tag or contains any code at all. That's not how it's supposed to work. Let's all try to keep in mind that requires statistical expertise to ask or answer is the test for software questions. If someone that knows SAS (say) but not stats couldn't give a full answer to a question relating to SAS because they didn't have the knowledge required, it's probably on topic. If all it would take is a quick check of the help, it's probably off topic.]
In response to mdewey's comment about the reopen queue -- if a question closes as unclear and hits the reopen queue and is now clear but off topic, please reopen, and then vote to close (or better vote to reopen and then flag it). The point about closure is that it's a signal to the poster (and indeed to other readers, including ones who don't have accounts) about how to write suitable questions. If it remains closed as unclear when it's NOT, that's a bad signal -- it doesn't help the poster write a better question next time; they'll be focused on the wrong issue. We need to try to get our questions closed for the "right" reason.