I give here a solution at the limite $b$, $n$, $k$ very large. And I am fairly confident that the best: The optimal strategy for the finite case is to alway play $\frac{b}{n}$ until you have more budget left than the same with small perturbationsnumber of head to get. It will give a probability of win equal to $$2 \mathcal{N}([\frac{k-b}{\sqrt{b(1-\frac{b}{n})}},\infty])$$ With $\mathcal{N}$ the gaussian measure.
We note $S(i)$ the number of heads up to time $i$ and $b(i)=b-\sum_{j<i}p(j)$ the budget you still have after $i$ flip. We define $X$ as $$X(i)=k-S(i)-b(i) $$
The central observation is the following : whatever the strategy you chose $X$ is a Martingale. Therefore for $n,b,k $ large and with a correct scaling it will converge to a continuous stochastic process.
We note $t=\frac{i}{n}$ and on $[0,1]$, and we change the notation such that $p(t)=p(i)$, $b(t)=\frac{b(i)}{n}$, $X(t)=\frac{1}{\sqrt{n}}X(i)$. At the limite the system evolves as follow:
$$\begin{cases}dX_t = \sigma(p(t))dB_t \\ db_t=-p(t)dt \end{cases}$$ where $\sigma(p(t))=\sqrt{p(t)(1-p(t))}$. The process $p(t)$ is our strategy and it should be think as $p(t,b_t,X_t)$ where $0\leq p(t)\leq 1$. With initial condition $X_0 = \frac{1}{\sqrt{n}}(k-b)$ and final condition $b(t=1)=0$.
As soon as $X_t=0$, we are in the situation $b\geq k$ one can set $p(s)=1$ and then $p(s)=0$ to finish. Therefore one have to obtimize $$ \mathbb{P}(\exists t : X_t\leq 0)$$ We have an explicit solution for $X$: $$X_t=X_0+B_{\int_0^t \sigma(p(s))^2 ds} $$ And then $$ \mathbb{P}(\exists t \in [0,1]: X_t\leq 0)= \mathbb{P}(\exists u \in [0,\int_0^1 \sigma(p(s))^2 ds]: B_u\leq -X_0)$$ We recall that $\int_0^1 \sigma(p(s))^2 ds$ is not a constant but a random variable depending on the chosen strategy. However here we remark the probability is monotone in $\int_0^1 \sigma(p(s))^2 ds$ and we can conclude : we should always chose $p$ such that $$\int_0^1 \sigma(p(s))^2 ds = \max_{p'} \int_0^1 \sigma(p'(s))^2 ds=\int_0^1 \frac{b}{n}(1-\frac{b}{n})ds= \frac{b}{n}(1-\frac{b}{n})$$ The last equalities follow from the fact that $x\rightarrow \sigma(x)^2$ is concave. And we have $$\max_{p'} \mathbb{P}(\exists t : X_t\leq 0)= \mathbb{P}(\min_{u\in [0,\frac{b}{n}(1-\frac{b}{n})]} B_u\leq -X_0)=2 \mathcal{N}(y \leq \frac{k-b}{\sqrt{b(1-\frac{b}{n})}})$$ With $\mathcal{N}$ the gaussian measure. (the last equality is a well known property of the maximum of the Brownian motion)