[Edit: moved to front] For which $(H,b)$ pairs, where $H$ is a Hamiltonian and $b$ is a basis, can we write:
$$\langle b_f\vert e^{-iHt/\hbar}\vert b_i\rangle=\int_{b(0)=b_i}^{b(t)=b_f} \mathcal{D}b(t)\, e^{iS[b(t)]},\tag{2}$$
where $S$ is real?
Background
The derivation of the path integral notion I am familiar with proceeds as follows. We would like to evaluate the propagator:
$$G(m,n,t)=\langle n\vert U(t)\vert m\rangle. $$
For some large number $N$, we break up the time evolution from $0$ to $t$ into $N$ pieces. For notational clarity, define:
$$W:=U\left(\frac{t}{N}\right),$$
so that:
$$G(m,n,t)= \langle n\vert W^N\vert m\rangle.$$
Now, denoting the matrix elements of $W$ by $W_{ij}$, we may write:
$$G(m,n,t)=\sum_{j,k,\ell,\dots}\underbrace{W_{nj}W_{jk}W_{k\ell}\cdots W_{\ell m}}_{\text{N times}}.$$
Thus we have written $G$ by summing over "histories" $\{j,k,\ell,\cdots\}$, with a product of $W$'s matrix elements being assigned to each history. [edited to add following Qmechanic's answer:] Assuming the $W_{ij}$'s are all nonzero, we may define $s_{ij}=-i\log W_{ij}$, and write:
$$G(m,n,t)=\sum_{i(t)\in\{\text{hists}\}}\exp\left(i\sum_{t}s_{i(t+1),i(t)}\right),$$
where now $s_{ij}$ has the interpretation of the increment of action. Note that nothing in our analysis so far has implied that $s$ is real.
For the particular case of working in the position basis with a Hamiltonian of the form $$H=p^2/(2m)+V(q),$$ a gaussian integral may be used to show that (as $N\to \infty$):
$$W_{ij}=\mathcal{N}e^{iF_{ij}},\tag{1}$$
with $F_{ij}$ real, which means that if we absorb the normalization into the definition of the path integral, the $s$'s are real.
This is kind of bizarre. To emphasize, what we have found is not that $W$ is unitary or any nice condition like that. We have found that all of the entries $W_{ij}$ have the same absolute value. I would not expect this property to be preserved under a unitary change of basis.
It is unobvious to me how general this result is (my suspicion is that it will definitely not hold for "most" Hamiltonians/bases). For which Hamiltonians/choice of bases are these matrix elements pure phases, and is there a simple or physical way to see that this must be so?
Counterexamples
I do not believe that (1) and (2) need to be satisfied in any basis for any choice of $H$. I will try to argue this by presenting 3 examples, in decreasing order of my confidence in them.
First consider $H=0$. In this case, $W_{x,x'}$ is nonzero when $x=x'$, and zero when $x\not =x'$. This shows that (1) cannot be satisfied, and indeed the $s$'s may not even be defined. I thus believe no $S$ exists to make (2) true.
We can also write down something pathological like:
$$H=\lambda\vert x=1\rangle\langle x=0\vert +\text{h.c.},$$
which, to my inexperienced eye, looks like $W_{0,0}$, $W_{0,1}$, and $W_{2,3}$ will all have different magnitudes. Again (1) cannot be satisfied.
Alternatively, we may consider a normal-looking Hamiltonian:
$$H=\frac{p^2}{2m}+E_0\log\left(1+\frac{x^2}{x_0^2}\right),$$
but consider the matrix elements of $W$ in the momentum basis. Doing the same Trotter formula trick and evaluating the integral over $x$ this time gives a result which I believe is not of the form $$W_{p,p'}=\mathcal{N}e^{iF(p,p')}$$ with $F$ real. I believe this because plugging in different values of $p$ and $p'$ numerically changes $\vert W_{p,p'}\vert ^2$.
Generically, for a separable local Hamiltonian $H(q,p)=K(p)+V(q)$, a phase-space path integral may be defined, and the position space path integral may be recovered by integrating out $p(t)$. I expect that only in the case of $K$ quadratic do we recover a position space path integral whose argument is of the form $e^{iS}$ for $S\in\mathbb{R}$, and generically the result would have a varying absolute value. I believe this provides some evidence that "representable as a real-action path integral wrt a particular basis" is a fairly strong constraint on Hamiltonians.
http://www.sciencedirect.com/science/article/pii/000349169290288W
"The functional integral constructed directly from the hamiltonian" by Farhi and Gutmann
– Aram Harrow Feb 01 '17 at 19:57