
This is a random smooth curve from (1, 0) to (10, 9) of length ~30. It is obtained through a recursive decoration, random curve of given length. This decoration takes four arguments: the scaling factor for the "random points", the scaling factor for the tangent vectors at the random points, the step variation for the first factor, and the desired length.
Some explanations concerning the construction
It is based on a style for random smooth curves introduced through a scope. This style takes one argument, the number of random points. It performs some computations (mainly introduce the random numbers needed in the sequel and some individual constants \cst{\i} that allow some control on the random tangent vectors for aesthetic reasons (see 2.).
The curve is constructed (if needed) using a decoration random curve test which takes only two arguments (the first two of the recursive decoration). See the figure below.

Assume we don't like the curve around the points 1 and 3. We change the sign of the individual constants and arrive at the next figure.

- We construct the desired curve using the recursive decoration.

I'm using @Gonzalo Medina idea for the length of the curve.
The seed if fixed through \pgfmathsetseed{19}. You might want to comment that line; notice that the testing phase makes no sense then. But there is a problem then; I decided to adopt a simple solution for the sign of the third argument of random curve of given length when it is invoked; it is based on the test step! If needed, I can modify the code...
The code (It produces the last drawing.)
\documentclass[11pt, margin=.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{math, calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathreplacing} % for show control points
\usepackage{pgfplots}
\makeatletter
\tikzset{%
measureme/.style={%
decoration={%
markings,
mark=at position 1 with {%
\tikzmath{
\lrc = \pgfdecoratedpathlength1pt/1cm;
}
\pgfextra{\xdef\lrcG{\lrc}}
}
},
postaction=decorate
},
for smooth random curve/.style={%
evaluate={%
int \N@glc, \M@glc, \i, \j;
real \lrc;
\N@glc = #1;
\M@glc = #1 +1;
for \i in {1, ..., \N@glc}{%
\rndPx{\i} = .5 +1.5rand;
\rndPy{\i} = .5 -1.5rand;
};
for \i in {0, ..., \M@glc}{%
\cst{\i} = 1;
\rndVm{\i} = .2 +abs(rand);
\rndVa{\i} = 180rand;
};
}
},
random curve test/.style 2 args={ % p scale / q scale
decoration={
show path construction,
lineto code={
\path (\tikzinputsegmentfirst) coordinate (P-0);
\path (\tikzinputsegmentlast) coordinate (P-\M@glc);
\path ($($(P-0)!1/\M@glc!(P-\M@glc)$) -(P-0)$) coordinate (v);
\foreach \i in {1, ..., \N@glc}{%
\path ($(P-0)!\i/\M@glc!(P-\M@glc)$)
let
\p1 = (v)
in ++({#1\rndPx{\i}\x1}, {#1\rndPy{\i}\y1})
coordinate (P-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\path ($(0, 0)!{#2\cst{\i}\rndVm{\i}}!\rndVa{\i}: (v)$)
coordinate (v-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\draw[green!70!black] (P-\i) circle (2pt) -- ++(v-\i)
node[pos=1.03, text=red] {\i};
}
\draw[measureme] (P-0)
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
}
},
decorate
},
random curve of given length/.style n args={4}{%
% p scale / q scale / step / length
decoration={
show path construction,
lineto code={
\path (\tikzinputsegmentfirst) coordinate (P-0);
\path (\tikzinputsegmentlast) coordinate (P-\M@glc);
\path ($($(P-0)!1/\M@glc!(P-\M@glc)$) -(P-0)$) coordinate (v);
\foreach \i in {1, ..., \N@glc}{%
\path ($(P-0)!\i/\M@glc!(P-\M@glc)$)
let
\p1 = (v)
in ++({#1\rndPx{\i}\x1}, {#1\rndPy{\i}\y1})
coordinate (P-\i);
}
\foreach \i in {0, ..., \M@glc}{%
\path ($(0, 0)!{#2\cst{\i}\rndVm{\i}}!\rndVa{\i}: (v)$)
coordinate (v-\i);
}
\path[measureme] (P-0) % produces \lrcG, the length
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
\tikzmath{%
\stp = #3;
\dMain = #4 -\lrcG;
if abs(\dMain)<.05 then {%
{%
\draw[red, measureme] (P-0)
\foreach \i [evaluate=\i as \j using {int(\i +1)}]
in {0, ..., \N@glc}{%
.. controls ++(v-\i) and ++([scale=-1] v-\j) .. (P-\j)
};
};
} else {%
if \dMain*\stp<0 then { \stp = -\stp/2; };
\pScale = #1 +\stp;
{%
\path[random curve of given length={\pScale}{#2}{\stp}{#4}]
(P-0) to (P-\M@glc);
};
};
}
}
},
decorate
}
}
\makeatother
\begin{document}
\begin{tikzpicture}[line cap=round]
\pgfmathsetseed{19}
\draw[gray!40] (0, 0) grid (10, 10);
\path (1, 0) coordinate (Pini);
\path (10, 9) coordinate (Pend);
\begin{scope}[for smooth random curve={4}]
\tikzmath{%
\cst{0} = 2;
\cst{1} = -1;
\cst{3} = -1;
}
\draw[random curve test={1}{1}] (Pini) to (Pend);
\draw[random curve of given length={1}{1}{.1}{30}] (Pini) to (Pend);
\end{scope}
\path let
\p1 = ($(Pend) -(Pini)$),
\n1 = {veclen(\x1, \y1)/1cm}
in (Pini) ++(3, -1) node {curve of length \lrcG};
\end{tikzpicture}
\end{document}