To compute the distribution of $Z$ for a general function $f$ might be difficult. To evaluate it, one could rewrite the process $(B_t)$$(B_s)_{0\le s\le t}$ as $B_s=W_s+(b-W_t)(s/t)$ for every $0\le s\le t$, where $(W_s)$$(W_s)_{s\ge0}$ is a standard 2D Brownian motion starting from $0$$W_0=0$.