I have C code that does this _very_ fast and uses a robust PRNG (MT, same as numpy, via GSL). Right now, it does not support replace. The code has to be GPL as it depends on GSL though. If we can find a suitable replacement for GSL then it should be fairly straightforward to put in place and wrap in cython