  Galaxy clusters are the products of structure formation through myriad
physical processes that affect their growth and evolution throughout cosmic
history. As a result, the matter distribution within galaxy clusters, or their
shape, is influenced by cosmology and astrophysical processes, in particular
the accretion of new material due to gravity. We introduce an analysis method
to investigate the 3D triaxial shapes of galaxy clusters from the Cluster
HEritage project with XMM-Newton -- Mass Assembly and Thermodynamics at the
Endpoint of structure formation (CHEX-MATE). In this work, the first paper of a
CHEX-MATE triaxial analysis series, we focus on utilizing X-ray data from XMM
and Sunyaev-Zel'dovich (SZ) effect maps from Planck and ACT to obtain a three
dimensional triaxial description of the intracluster medium (ICM) gas. We
present the forward modeling formalism of our technique, which projects a
triaxial ellipsoidal model for the gas density and pressure to compare directly
with the observed two dimensional distributions in X-rays and the SZ effect. A
Markov chain Monte Carlo is used to estimate the posterior distributions of the
model parameters. Using mock X-ray and SZ observations of a smooth model, we
demonstrate that the method can reliably recover the true parameter values. In
addition, we apply the analysis to reconstruct the gas shape from the observed
data of one CHEX-MATE galaxy cluster, Abell 1689, to illustrate the technique.
The inferred parameters are in agreement with previous analyses for that
cluster, and our results indicate that the geometrical properties, including
the axial ratios of the ICM distribution, are constrained to within a few
percent. With much better precision than previous studies, we thus further
establish that Abell 1689 is significantly elongated along the line of sight,
resulting in its exceptional gravitational lensing properties.
