Fundamental "definition" of momentum In introductory classical mechanics, we come across the quantity momentum defined as $p=mv$. There seems to be no other "definition" of momentum, (apart from the vague "measure of quantity of motion") and the only role it seems to play is in defining the force $F$ in Newton's second law $F=\dfrac{dp}{dt}$. In the absence of an external force, the "momentum" of a system of particles is conserved. So I believe the momentum can be defined as quantity that is conserved in the absence of an external forces.
From relativistic mechanics, we now know that momentum needs to be redefined as $p=\gamma m v$. Also, the energy $E$, follows the equation:
$$E=\sqrt{(pc)^2 + (mc^2)^2}$$
Setting $m=0$, we get $E=E_{photon}=hf = p_{photon}c$, so $p_{photon}=hf/c=h/\lambda$.
So now we have the complete description for momentum:
$$p = \begin{cases}
m\neq0(\equiv v\neq c)&:\gamma mv \\                    
 m=0(\equiv v=c)  &: h/\lambda \\            
\end{cases}$$
My question is: Instead of this "piece-wise" definition of momentum, is there not a unified, fundamental definition, that combines both of these aspects together? I.e $h/\lambda$ for massless particles and $\gamma mv$ otherwise?
Another, related question was that what does "momentum" even mean for a massless object? The old "measure of quantity of motion" makes no sense here.
After a brief discussion with John Rennie sir in chat, he told me that a possible unified definition can be that "momentum is a conserved quantity that arises when the lagrangian has shift symmetry", i.e when the Lagrangian is invariant under the transformation $r \to r+c$.
However, do terms like Lagrangian even make sense when we try to include massless objects?
 A: I would agree with John's suggestion that the most "fundamental" definition of momentum is the quantity that is conserved when the Lagrangian is invariant under spatial translations $\mathbf{x}\rightarrow\mathbf{x}+\mathbf{s}$.

However, do terms like Lagrangian even make sense when we try to include massless objects?

Yes, absolutely. In fact the machinery used to describe such particles, quantum field theory, is expressed in terms of Lagrangians.
Lagrangian mechanics and generalized momentum

Let's start with the simpler classical dynamics notion of momentum. We start with a Lagrangian, expressed in terms of the generalized coordinates $q_i$ and their time derivatives,
$$L(q_i, \dot{q}_i)=T(\dot{q}_i)-V(q_i)$$
where $T$ and $V$ are the kinetic and the potential energies, respectively. The reason we care about the Lagrangian is that it allows us to easily derive the equations of motion for the system under consideration using the Euler-Lagrange equations,
$$\frac{\partial L}{\partial q_i}-\frac{d}{dt}\left(\frac{\partial L}{\partial\dot{q}_i}\right)=0$$
which are a direct result of the principle of least action. There is a famous and beautiful theorem in mechanics by Emmy Noether, which states that for every continuous symmetry of the Lagrangian there exists some quantity that stays the same throughout time. More precisely, for some continuous transformation parameterised by $s$, $q_i(t)\rightarrow Q_i(s,t)$, if
$$\frac{\partial}{\partial s}L(Q_i(s,t),\dot{Q}_i(s,t),t)=0$$
then the quantity
$$\sum_i\frac{\partial L}{\partial\dot{q}_i}\frac{\partial Q_i}{\partial s}$$
is conserved though all time. These $\partial L/\partial\dot{q}_i$ are known as generalized momenta.
Defining momentum
Consider the specific case of a collection of free particles, which has a Lagrangian
$$L=\frac{1}{2}\sum_i m_i\dot{\mathbf{x}}_i^2-V(|\mathbf{x}_i-\mathbf{x}_j|)$$
Now consider making a translation $\mathbf{x}_i\rightarrow\mathbf{x}_i+s\mathbf{n}$ where $\mathbf{n}$ is an arbitrary vector. The above Lagrangian is clearly invariant under such a transformation. Therefore we know per Noether's theorem that the quantity
$$\sum_i\frac{\partial L}{\partial\dot{\mathbf{x}}_i}\frac{\partial(s\mathbf{n})}{\partial s}=\sum_i m_i\dot{\mathbf{x}}_i\cdot\mathbf{n}$$
is conserved. But this is just our usual conservation of the total momentum $\sum\mathbf{p}_i=\sum m_i\dot{\mathbf{x}}_i$ along the direction of $\mathbf{n}$! So we see that the quantity momentum naturally arises as the thing that is conserved under space-translation symmetry.
But this notion of momentum extends much further than free particles. It can be applied to any Lagrangian with space-translation symmetry, with the conserved quantities that arise being given the label momentum.
So now, how do massless particles like photons fit into this? For describing particles such as photons we use quantum field theory, however it suffices here to stick to the classical theory.
Lagrangian of fields

Like the name suggests, in field theory our dynamical variables are fields which are themselves functions of space and time (or, spacetime). As such we replace the usual Lagrangian with a Lagrangian density, $\mathcal{L}$ which is defined by
$$L=\int\mathrm{d}^3\mathbf{x}\,\mathcal{L}(\phi(x),\partial_\mu\phi(x),t)$$
where $\phi(x)$ is the field as a function of spacetime coordinate $x=(t,\mathbf{x})$ and $\partial_\mu=\partial/\partial x^\mu=(\partial/\partial t,\nabla)$ is the four-gradient.
Despite all these apparent differences Noether's theorem remains more-or-less unchanged, except now what matters is symmetry in the fields rather than the coordinates. You know how we considered a spatial translation before? Well there is in fact also a conserved quantity under time translational symmetry: energy. In field theory, we can go one step further and consider spacetime translations, $x^\mu\rightarrow x^\mu+\varepsilon^\mu$. I won't go into the details of the derivation here (you can find it in any decent field theory book), but the conserved quantity (called a conserved current now) that pops out is something called the energy-momentum tensor:
$$\mathcal{T}^{\mu\nu}=\frac{\partial\mathcal{L}}{\partial(\partial_\mu\phi)}\partial^\nu\phi-\eta^{\mu\nu}\mathcal{L}$$
where $\eta^{\mu\nu}$ is the Minkowski metric. The four-momentum is then identified with the $0\mu$ components:
$$p^\mu=\int\mathrm{d}^3\mathbf{x}\,\mathcal{T}^{0\mu}$$
From which the 3-momentum can be defined as $p^i$.
As an example, consider the Lagrangian for electrodynamics in the absence of sources:
$$\mathcal{L}=-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$$
where
$$F^{\mu\nu}=\partial^\mu A^\nu-\partial^\nu A^\mu=\begin{pmatrix}0  & -E_x & -E_y & -E_z \\
     E_x &  0     & -B_z   &  B_y    \\
     E_y &  B_z   &  0     & -B_x   \\
     E_z & -B_y   &  B_x   &  0
     \end{pmatrix}$$
is the EM tensor, with $A^\mu=(\phi,\mathbf{A})$ being the four-potential. The energy-momentum tensor for this theory is (in SI units now, for clarity)
$$\mathcal{T}^{\mu\nu} = \frac{1}{\mu_0} \left[ F^{\mu \alpha}F^\nu{}_{\alpha} - \frac{1}{4} \eta^{\mu\nu}F_{\alpha\beta} F^{\alpha\beta}\right]=\begin{pmatrix} \frac{1}{2}\left(\varepsilon_0 E^2+\frac{1}{\mu_0}B^2\right) & S_\text{x}/c & S_\text{y}/c & S_\text{z}/c \\
S_\text{x}/c & -\sigma_\text{xx} & -\sigma_\text{xy} & -\sigma_\text{xz} \\
S_\text{y}/c & -\sigma_\text{yx} & -\sigma_\text{yy} & -\sigma_\text{yz} \\
S_\text{z}/c & -\sigma_\text{zx} & -\sigma_\text{zy} & -\sigma_\text{zz} \end{pmatrix}$$
where $\mathbf{S}=(\mathbf{E}\times\mathbf{B})/\mu_0$ is the Poynting vector and $\sigma_{ij}$ is the Maxwell stress tensor. I leave it as an exercise to verify that for electromagnetic waves we indeed have $E=|\mathbf{p}|c$ (i.e. $(\mathcal{T}^{00})^2=\sum_i(\mathcal{T}^{0i})^2$).
A: A treatment in which $m\ne0$ doesn't need a separate discussion:
The four-momentum $p^\mu$ and four-force $f^\mu$ satisfy $f^\mu=\frac{d}{d\tau}p^\mu$ (which reduces to a conservation law in the absence of an external four-force) and $p^\mu p_\mu=m^2c^2$ if we keep dimensions consistent in the convention $p^0=E/c$. (Personally, I'd recommend setting $c=1$ to avoid such considerations.) In particular, $p^\mu f_\mu=0$. The three-momentum is the space part of $p^\mu$, $p^i$.
The quantum-mechanical addition is $p^\mu=\hbar k^\mu$ with $k^\mu$ the four-frequency, with wavevector $k^i$ and wavelength $\lambda=2\pi/\sqrt{k^ik_i}$ if we work in $-+++$.
A: In quantum mechanics the volume integrated momentum of a free particle is always $h/\lambda$. Light consists of massless particles and Maxwell's equations are what the Schrödinger equation is for massive particles. The formula $p=m\gamma v$ holds for any mass except zero but in all cases, $p=\sqrt{E^2-m^2c^4}/c$.
