If the total number of $1$ digits is $2^k,$ then we can group the ones digits as $1+1+2+4+\dots+2^{k-1}$ in $k+1$ places, with one zero after, and $n-2^k-1$ zeros out after $1,1,2,\dots,2^{k-1}.$ This is the number of non-negative integer solutions to:
$$x_1+x_2+\dots+x_{k+1}=n-2^k-1.$$
which is $\binom {n+k-2^k-1}{k}.$
For example, when $n=6$ and $k=2,$ we get strings of the form:
$$10^*10^*110^*0$$
To make the string of length $6,$ we need one more zero, other than the one at the end, so there are $3$ ways to place that one zero.
So you function is:
$$f(n)= \sum_{2^k<n} \binom{n+k-2^k-1}{k}$$
When $n=5,$ this gives:
$$\binom{5-2}{0}+\binom{5-2}{1}+\binom{2}{2}=1+3+1=5.$$
When $n=6,$ you get:
$$\binom{4}{0}+\binom{4}1+\binom{3}{2}=8.$$
I doubt this will have a closed form.
The function grows faster than polynomial time, since, for $n>2^k,$ $f(n)>\binom{n+k-2^k-1}{k}.$ which is a polynomial of degree $k$ in $n.$
We get an easy upper bound $f(n)<2^{n-2}.$ It might be interesting to compute $\limsup \frac{\log f(n)}{n}.$ I can't see that, but I would not be surprised if it was $0.$
If $f(n)$ is our function, then I think we get a generating function:
$$F(x)=\sum_{n=0}^\infty f(n)x^n=\sum_{k=0}^{\infty}\frac{x^{2^k+1}}{(1-x)^{k+1}}$$
Again, it seems unlikely this will have a closed form.
This does give us an interesting generalization, if $A=\{a_0<a_1<\dots\}$ is an infinite set of positive natural numbers and $f(n)$ is the number of $n$-bit numbers starting with $1$ and ending with $0$ such that the number of $1$s to the left of any $0$ is in $A,$ then:
$$\sum f(n)x^n=\sum_{k}\frac{x^{a_k+1}}{(1-x)^{k+1}}$$ and $$f(n)=\sum_{k, a_k<n}\binom{n+k-a_k-1}{k}$$
If $a_k=2k+1$ are the odd numbers:
$$\sum_n f(n)x^n = \frac{\frac{x^2}{1-x}}{1-\frac{x^2}{1-x}}= \frac{x^2}{1-x-x^2}$$
And we get that $f(n)=F_{n-1}$ where $F_k$ is the $k$th Fibonacci number.