Comments to the question (v2):

1) The correspondence between Lagrangian (L) and Hamiltonian (H) theories is mired with subtleties. Some general tools for singular Legendre transformations are available, such as Dirac-Bergmann analysis, Faddeev-Jackiw method, etc. But rather than claiming complete understanding and existence of the L-H correspondence, it is probably more fair to say that we have a long list of theories (such as e.g. Yang-mills, Cherns-Simons, GR, etc.), where both sides of the L-H correspondence have been worked out.

2) In general path integrals are poorly understood beyond a perturbative expansion around a Gaussian free theory, so to ponder what happens if the momenta $p$ are not quadratic, is just part of a bigger problem.

3) A fundamental difference between Lagrangian and Hamiltonian theories is that there formally exists a canonical choice of path integral measure in Hamiltonian theories, while the Lagrangian path integral measure traditionally is only fixed modulo gauge-invariant factors. In that sense the Hamiltonian formulation is more fundamental.

In detail, if we assume that the phase space a Hamiltonian theory is equipped with a symplectic two-form

$$\tag{1} \omega~=~\frac{1}{2} dz^I ~\omega_{IJ} \wedge dz^J,$$

there is a canonical measure factor

$$\tag{2} \rho~=~ {\rm Pf}(\omega_{IJ})$$

given by the (super) Pfaffian,
at least for finite-dimensional integrals, which under favorable circumstances can be generalized to infinite dimensions. This measure factor $\rho$ is just 1 in Darboux coordinates $(q^1, \ldots, q^n, p_1, \ldots , p_n)$ with $\omega = dp_i \wedge dq^i$.

## Best Answer

The Lagrangian for Electromagnetism follows

uniquelyfrom requiring renormalizability and gauge invariance (plus parity time reversal)## U(1) gauge Invariance

if you require your Lagrangian to be

locallyinvariant under symmetry operations of the unitary group U(1) that is under$$\phi\to e^{i\alpha(x)}\phi$$

all derivatives $\partial_\mu$ have to be replaced by the

covariant derivative$D_\mu = \partial_\mu+ieA_\mu$, where, in order to save local invariance the gauge field is introduced. Loosely speaking this is necessary to make fields at different spacetiem points comparable Since two points may have an arbitrary phase difference, due to the fact that we can set $\alpha(x)$ as we wish, something has to compensate this difference, before we can compare fields, which is what differentiation basically does. This is similar to parallel transport in general relativity (the mathematical keyword isconnectionsee wiki: Connection (wiki) The gauge field $A_\mu$ transforms as $A_\mu \to A_\mu - \frac{1}{e}\partial_\mu\alpha(x)$.Now the question is what kind of Lagrangians we can build with this requirement. For matter (i.e. non-gauge) fields it's easy to construct gauge invariant quantities by just replacing the derivatives with the covariant derivatives, i.e.

$$\bar{\psi}\partial_\mu\gamma^\mu\psi\to \bar{\psi}D_\mu\gamma^\mu\psi$$,

this will yield kinetic terms for the field (the part with the normal derivative), and interactions terms between matter fields and the gauge field.

## Gauge-Field only terms

the remaining question is how to construct terms involving only the gauge field and no matter fields (i.e. the 'source-free' terms your question is about). For this we must construct gauge-invariant germs of $A_\mu$.

Once $\alpha(x)$ is chosen we can imagine starting from a point and walking on a loop back to that same point (this is called a wilson loop (wiki)). This must necessarily be gauge invariant since any phase that we pick up on the way we must also loose on the way back. It turns out, that this is exactly the term $F_{\mu\nu}$, i.e. the field strength. (the calculation is a little longer, see Peskin & Schroeder page 484). Actually this is only true for abelian symmetries such as U(1), for non abelian ones such as SU(3) we will get some interaction terms between the gauge fields which is why light does not interact with itself but gluons do.

Bilinear mass terms such as $A_\mu A^\mu$ are

notgauge invariant (in the end this is the need for the Higgs meachanism)## Renormalizability

If we wish that our theory is renormalizable, we can only include terms into the lagrangian up to mass dimension 4. Now listing all terms up to mass dimension 4 we arrive at

$$\mathcal{L} = \cdot\bar{\psi}D_\mu\psi - m\bar{\psi}\psi - b\cdot F_{\mu\nu}F^{\mu\nu} + d\cdot \epsilon^{\alpha\beta\gamma\delta}F_{\alpha\beta}F_{\gamma\delta}$$

the last term involves the anti-symmetric tensor $\epsilon^{\alpha\beta\gamma\delta}$ and is therefore not time and parity invariant.

Note that we have not included linear terms here since we will be expanding around a local minimum anyways, so that the linear term will vanish.

## Conclusion

if we require U(1) gauge invariance and renormalizability (mass dimension up to 4) and time and parity invariance we only get

$$\mathcal{L} = \cdot\bar{\psi}D_\mu\psi - m\bar{\psi}\psi - b\cdot F_{\mu\nu}F^{\mu\nu}$$

In the source-free case this is

$$\mathcal{L} = - b\cdot F_{\mu\nu}F^{\mu\nu}$$

the overall factor $\frac{1}{4}$ is not important.