Minimize Least Used Binary Bits in Fractions
Node.js, Score = 7873
This is both naive and rather long...

Code size = 129 bytes
Total penalty = 2336
Score = round(1291/4 * 2336) = 7873

Takes input as [p, q]. Returns [p', q', f(p, q)].

f=(a,r=[k=6e3])=&gt;k--?f(a,(i=Math.max(...a.map(n=&gt;(g=n=&gt;n?g(n&gt;&gt;1,n&amp;1?++o:++z):o&lt;z?o:z)(a=(p=a,n*k),o=z=0))))&gt;r[2]?r:[p,a,i],k--):r

Try it online! for the test cases
or compute the total penalty by processing the whole test set

Alternate version, Score = 8426
A modified version to reach a total penalty of 2330. But it's not worth it...

Code size = 171 bytes
Total penalty = 2330
Score = round(1711/4 * 2330) = 8426

Same I/O format as the main version.
f=(a,r=[k=5e3])=&gt;k--?f(a,(i=Math.max(...a.map(n=&gt;(g=n=&gt;n?g(n&gt;&gt;1,n&amp;1?++o:++z):o&lt;z?o:z)(a=(p=a,n*([7007,7901,16239,32695,130527,261599][k]||k-5)),o=z=0))))&gt;r[2]?r:[p,a,i]):r

Try it online!
It includes some hardcoded values for the highest multipliers. They were found by generating all bitmasks m with up to 32 bits and no more than 5 0's, keeping the values for which m mod p = 0, checking the score of q * m / p and finally doing the same operation with the inverted bitmask of m of the same length (no more than 5 1's with all other bits set to 0).