Nonlinear deformations of a two-dimensional gas bubble are investigated in the framework of a Hamiltonian formulation involving surface variables alone. The Dirichlet-Neumann operator is introduced to accomplish this dimensional reduction and is expressed via a Taylor series expansion. A recursion formula is derived to determine explicitly each term in this Taylor series up to an arbitrary order of nonlinearity. Both analytical and numerical strategies are proposed to deal with this nonlinear free-boundary problem under forced or freely oscillating conditions. Simplified models are established in various approximate regimes, including a Rayleigh-Plesset equation for the time evolution of a purely circular pulsating bubble, and a second-order Stokes wave solution for weakly nonlinear shape oscillations that rotate steadily on the bubble surface. In addition, a numerical scheme is developed to simulate the full governing equations, by exploiting the efficient and accurate treatment of the Dirichlet-Neumann operator via the fast Fourier transform. Extensive tests are conducted to assess the numerical convergence of this operator as a function of various parameters. The performance of this direct solver is illustrated by applying it to the simulation of cycles of compression-dilatation for a purely circular bubble under uniform forcing, and to the computation of freely evolving shape distortions represented by steadily rotating waves and time-periodic standing waves. The former solutions are validated against predictions by the Rayleigh-Plesset model, while the