You just do the obvious thing, which is to check if the number is odd, if not, you divide by 2 until you get an odd number. There is no known way to speed up the process.
If you think about it, this is similar to asking whether or not a polynomial has a double root. For this we have the derivative to help. Unfortunately, for integers we do not have a method to check for repeated primes.