Can we decide if a number is a power of any given $K$ in polynomial-time?


It is simple to decide powers of 2 in $ O(n)$ time because it’s just "0-bit Unary" after bit-1. (eg. $ 1000$ is a power of 2 in binary).

I haven’t found many other trivial powers of $ K$ that can be decided in polynomial-time with the binary-length of the input.

Question

Can we decide if a number is a power of any given $ K$ in polynomial-time and in a practical amount of time?

Something not naive such as keep dividing $ N$ by $ K$ until you reach the smallest value $ 2$ for deciding a power of 2.