[FEN "b3r3/1R1p1p1q/1p1P1P1b/1Pk1BR2/1rN1K1Nq/p7/P1P1B1P1/1qn1q1nq w - - 0 1"]
Here is an (ugly) suggestion wth 29 units.
White is stalemated with 8 pins; removing any Black unit would break the stalemate.
White has promoted one of her three missing pawns (to knight) and black Black has promoted all of her fivetheir four missing pawns (two into rooks, two into light-squared bishops, and oneall into a knightqueens).
The fourthree captures (white queen, and 2 white pawns and 1 black pawn) ensure that this position is reachable. I am pretty sure we could add at least one of theThe three missing pawns butWhite pieces ensure that would require some retrograde analysis to prove the legalityposition is legal and that Black could have promoted all four of their missing pawns.
The Black g-pawn captured the positionWhite h-pawn to produce doubled pawns that is beyond both my motivationpromoted. The Black c-pawn captured the White queen to bypass the White pawn structure and my available timepromote. For instanceFinally, adding a white pawn on b2 doesn't workthe White e-pawn was captured and then the Black e-pawn marched down and promoted.
This is optimal because it won't4 pawns must be possible anymorepromoted to promote all black pawnscreate 8 pins, with requires a minimum of 3 units, thus leaving 29 left for the final position.