  For an abelian variety $A$ over a number field $F$, we prove that the average
rank of the quadratic twists of $A$ is bounded, under the assumption that the
multiplication-by-3 isogeny on $A$ factors as a composition of 3-isogenies over
$F$. This is the first such boundedness result for an absolutely simple abelian
variety $A$ of dimension greater than one. In fact, we exhibit such twist
families in arbitrarily large dimension and over any number field.
  In dimension one, we deduce that if $E/F$ is an elliptic curve admitting a
3-isogeny, then the average rank of its quadratic twists is bounded. If $F$ is
totally real, we moreover show that a positive proportion of twists have rank 0
and a positive proportion have $3$-Selmer rank 1. These results on bounded
average ranks in families of quadratic twists represent new progress towards
Goldfeld's conjecture -- which states that the average rank in the quadratic
twist family of an elliptic curve over $\mathbb{Q}$ should be $1/2$ -- and the
first progress towards the analogous conjecture over number fields other than
$\mathbb{Q}$.
  Our results follow from a computation of the average size of the
$\phi$-Selmer group in the family of quadratic twists of an abelian variety
admitting a 3-isogeny $\phi$.
