julia> a = rand(("0", "1"), 10^6);
julia> @btime [parse(Int, x) for x in $a];
36.087 ms (3 allocations: 7.63 MiB)
julia> @btime parse.(Int, $a);
35.576 ms (2 allocations: 7.63 MiB)
It seems pretty fast to me.
If, however, the inputs are Chars instead of Strings, it can get faster:
julia> c = rand('0':'1', 10^6);
julia> @btime parse.(Int, $c);
8.302 ms (2 allocations: 7.63 MiB)
If you don’t need to validate inputs and these are the only two options, something like
parse01(str) = str == "1" ? 1 : 0
could work, eg
julia> @btime parse01.($a);
4.704 ms (2 allocations: 7.63 MiB)
but, like the others contributing to this topic, I wonder if this is really the bottleneck in your code. I would go with parse(Int, ...) as the cost is trivial in any case, and it is robust and readable.