Yes, but if you don't have a special formula and all you have is a string, that doesn't help.

Note: this was discussed on the Mersenne forum, starting here:
http://www.mersenneforum.org/showthread.php?p=434341#post434341

Charles Greathouse
Case Western Reserve University

On Mon, May 23, 2016 at 4:46 PM, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Mon, May 23, 2016 at 01:47:41PM -0400, Charles Greathouse wrote:
> Package: pari-stable
> Version: all
> Severity: wishlist
>
> When gp encounters decimal numbers (in strings, at least, with read or
> eval) it converts them to the native format using what appears to be a
> quadratic algorithm:
>
> > s=Str(10^10^6);
> time = 125 ms.
> > eval(s);
> time = 1,892 ms.
> > s=Str(10^10^7);
>   *** Str: Warning: increasing stack size to 40000000.
>   *** Str: Warning: increasing stack size to 80000000.
> time = 2,109 ms.
> > eval(s);
>   *** eval: Warning: increasing stack size to 40000000.
> time = 4min, 30,219 ms.
> > log((4*60+30.219)/1.892)/log(10)
> %1 = 2.1547947503887454560124003527679024030
>
> It looks like GMP does this pretty well; anecdotally around 100 time faster
> for large numbers. This may be as easy as hooking into gmp_sscanf at some
> point if GMP is used.

Try:
fromdigits(vector(10^7+1,i,i==1))

Cheers,
Bill.