Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, gcd, lcm 
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string
#include <vector> // vector
#include <queue> // queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <cstdint> // int64_t, int_fast64_t

#define rep(i,n) for(ll i = 0; i < n; i++)
#define ENDL "\n"

typedef std::int_fast64_t ll; // at least int64 > 9*10^18
typedef std::uint_fast64_t ull; // at least uint64

template<typename T,T MOD = 1000000007>
struct Mint{
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1);
    Mint tmp(this->v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }
  
  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}
  
  Mint inv(){return pow(MOD-2);}
  
  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}
  
  Mint operator+(Mint a) const{return Mint(v)+=a;};
  Mint operator-(Mint a) const{return Mint(v)-=a;};
  Mint operator*(Mint a) const{return Mint(v)*=a;};
  Mint operator/(Mint a) const{return Mint(v)/=a;};

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}
  
  static Mint comb(long long n,int k){
    Mint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
};
signed main() {
  std::string l;
  std::cin >> l;
  ll len = l.length();
  ll ones = 0;
  rep(i,len) if(l[i]=='1') ones++;
  Mint<ll> two = Mint<ll>(2);
  Mint<ll> sum = Mint<ll>(0);
  rep(i,ones+1) sum+=two.pow(ones-i)*Mint<ll>::comb(len,i);
  std::cout << sum.v << ENDL;

  return 0;
}

Compiler output:
a.cc: In instantiation of 'Mint<T, MOD> Mint<T, MOD>::pow(long long int) [with T = long int; T MOD = 1000000007]':
a.cc:80:29:   required from here
   80 |   rep(i,ones+1) sum+=two.pow(ones-i)*Mint<ll>::comb(len,i);
      |                      ~~~~~~~^~~~~~~~
a.cc:33:10: error: call of overloaded 'Mint(long int&)' is ambiguous
   33 |     Mint tmp(this->v);
      |          ^~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:28:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   28 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   25 | struct Mint{
      |        ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(Mint<long int>&&)'
a.cc: In instantiation of 'Mint<T, MOD> Mint<T, MOD>::operator*(Mint<T, MOD>) const [with T = long int; T MOD = 1000000007]':
a.cc:80:58:   required from here
   80 |   rep(i,ones+1) sum+=two.pow(ones-i)*Mint<ll>::comb(len,i);
      |                                                          ^
a.cc:54:39: error: call of overloaded 'Mint(const long int&)' is ambiguous
   54 |   Mint operator*(Mint a) const{return Mint(v)*=a;};
      |                                       ^~~~~~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:28:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   28 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   25 | struct Mint{
      |        ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(Mint<long int>&&)'
a.cc: In instantiation of 'Mint<T, MOD> Mint<T, MOD>::operator/(Mint<T, MOD>) const [with T = long int; T MOD = 1000000007]':
a.cc:69:15:   required from 'static Mint<T, MOD> Mint<T, MOD>::comb(long long int, int) [with T = long int; T MOD = 1000000007]'
   69 |     return num/dom;
      |            ~~~^~~~
a.cc:80:52:   required from here
   80 |   rep(i,ones+1) sum+=two.pow(ones-i)*Mint<ll>::comb(len,i);
      |                                      ~~~~~~~~~~~~~~^~~~~~~
a.cc:55:39: error: call of overloaded 'Mint(const long int&)' is ambiguous
   55 |   Mint operator/(Mint a) const{return Mint(v)/=a;};
      |                                       ^~~~~~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:28:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   28 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   25 | struct Mint{
      |        ^~~~
a.cc:25:8: note: candidate: 'constexpr Mint<long int>::Mint(Mint<long int>&&)'