We can solve this via a couple of "tricks" and a little math.
Here is the basic algorithm:
- Generate a Geometric random variable with probability of success $p$.
- The outcome of this random variable determines a fixed known value $f_n \in [0,1]$.
- Generate a $\mathrm{Ber}(f_n)$ random variable using fair coin flips generated from blockwise paired flips of our $\mathrm{Ber}(p)$ coin.
- The resulting outcome will be $\mathrm{Ber}(p^a)$ for any $a \in (0,1)$, which is all we need.
To make things more digestible, we'll break things into pieces.
Piece 1: Without loss of generality assume that $0 < a < 1$.
If $a \geq 1$, then, we can write $p^a = p^n p^b$ for some positive integer $n$ and some $0 \leq b < 1$. But, for any two independent Bernoulli's, we have
$$\renewcommand{\Pr}{\mathbb P}
\Pr(X_1 = X_2 = 1) = p_1 p_2 \>.
$$
We can generate a $p^n$ Bernoulli from our coin in the obvious way. Hence, we need only concern ourselves with generating the $\mathrm{Ber}(p^a)$ when $a \in (0,1)$.
Piece 2: Know how to generate an arbitrary $\mathrm{Ber}(q)$ from fair coin flips.
There is a standard way to do this. Expand $q = 0.q_1 q_2 q_3 \ldots$ in its binary expansion and then use our fair coin flips to "match" the digits of $q$. The first match determines whether we declare a success ("heads") or failure ("tails"). If $q_n = 1$ and our coin flip is heads, declare heads, if $q_n = 0$ and our coin flip is tails, declare tails. Otherwise, consider the subsequent digit against a new coin flip.
Piece 3: Know how to generate a fair coin flip from unfair ones with unknown bias.
This is done, assuming $p \in (0,1)$, by flipping the coin in pairs. If we get $HT$, declare a heads; if we get $TH$, declare a tails, and otherwise repeat the experiment until one of the two aforementioned outcomes occurs. They are equally probable, so must have probability $1/2$.
Piece 4: Some math. (Taylor to the rescue.)
By expanding $h(p) = p^a$ around $p_0 = 1$, Taylor's theorem asserts that
$$
p^a = 1 - a(1-p) - \frac{a(1-a)}{2!} (1-p)^2 - \frac{a(1-a)(2-a)}{3!} (1-p)^3 \cdots \>.
$$
Note that because $0 < a < 1$, each term after the first is negative, so we have
$$
p^a = 1 - \sum_{n=1}^\infty b_n (1-p)^n \>,
$$
where $0 \leq b_n \leq 1$ are known a priori. Hence
$$
1 - p^a = \sum_{n=1}^{\infty} b_n (1-p)^n = \sum_{n=1}^\infty b_n \Pr(G \geq n) = \sum_{n=1}^\infty f_n \Pr(G = n) = \mathbb E f(G),
$$
where $G \sim \mathrm{Geom}(p)$, $f_0 = 0$ and $f_n = \sum_{k=1}^n b_k$ for $n \geq 1$.
And, we already know how to use our coin to generate a Geometric random variable with probability of success $p$.
Piece 5: A Monte Carlo trick.
Let $X$ be a discrete random variable taking values in $[0,1]$ with $\Pr(X = x_n) = p_n$. Let $U \mid X \sim \mathrm{Ber}(X)$. Then
$$
\Pr(U = 1) = \sum_n x_n p_n.
$$
But, taking $p_n = p(1-p)^n$ and $x_n = f_n$, we see now how to generate a $\mathrm{Ber}(1-p^a)$ random variable and this is equivalent to generating a $\mathrm{Ber}(p^a)$ one.