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(int 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

#define int ll
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),tmp(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;
  int len = l.length();
  int ones = 0;
  rep(i,len) if(l[i]=='1') ones++;
  Mint<int> two = Mint<int>(2);
  Mint<int> sum = Mint<int>(0);
  rep(i,ones+1) sum+=two.pow(ones-i)*Mint<int>::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<int>::comb(len,i);
      |                      ~~~~~~~^~~~~~~~
a.cc:33:17: error: call of overloaded 'Mint(long int&)' is ambiguous
   33 |     Mint res(1),tmp(v);
      |                 ^~~
a.cc:30:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   30 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:26:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   26 | struct Mint{
      |        ^~~~
a.cc:26:8: note: candidate: 'constexpr Mint<long int>::Mint(Mint<long int>&&)'
a.cc: In instantiation of 'static Mint<T, MOD> Mint<T, MOD>::comb(long long int, ll) [with T = long int; T MOD = 1000000007; ll = long int]':
a.cc:80:53:   required from here
   80 |   rep(i,ones+1) sum+=two.pow(ones-i)*Mint<int>::comb(len,i);
      |                                      ~~~~~~~~~~~~~~~^~~~~~~
a.cc:67:12: error: call of overloaded 'Mint(ll)' is ambiguous
   67 |       dom*=Mint(i+1);
      |            ^~~~~~~~~
a.cc:30:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   30 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:26:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   26 | struct Mint{
      |        ^~~~
a.cc:26: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:59:   required from here
   80 |   rep(i,ones+1) sum+=two.pow(ones-i)*Mint<int>::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:30:3: note: candidate: 'Mint<T, MOD>::Mint(long long int) [with T = long int; T MOD = 1000000007]'
   30 |   Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}
      |   ^~~~
a.cc:29:3: note: candidate: 'Mint<T, MOD>::Mint(int) [with T = long int; T MOD = 1000000007]'
   29 |   Mint(signed v):v(v){}
      |   ^~~~
a.cc:26:8: note: candidate: 'constexpr Mint<long int>::Mint(const Mint<long int>&)'
   26 | struct Mint{
      |        ^~~~
a.cc:26:8: note: candidate: 'constexpr Mint<long int>::Mint(Mint<long int>&&)'